Skip to content

Commit

Permalink
testing: fix config tests in test_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
frrist committed Oct 30, 2024
1 parent 9fb3af7 commit fe291ae
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
7 changes: 4 additions & 3 deletions test_integration/1_orchestrator_basic_config_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package test_integration
import (
"context"
"fmt"
"strings"
"testing"

"github.com/google/uuid"
"github.com/stretchr/testify/suite"
"github.com/testcontainers/testcontainers-go/exec"
"strings"
"testing"
)

type OrchestratorBasicConfigSuite struct {
Expand Down Expand Up @@ -65,7 +66,7 @@ func (s *OrchestratorBasicConfigSuite) TestOrchestratorNodeUpAndEnabled() {
marshalledOutput, err := s.unmarshalJSONString(agentConfigOutput, JSONObject)
s.Require().NoErrorf(err, "Error unmarshalling response: %q", err)

orchestratorEnabled := marshalledOutput.(map[string]interface{})["Orchestrator"].(map[string]interface{})["Enabled"].(bool)
orchestratorEnabled := marshalledOutput.(map[string]interface{})["config"].(map[string]interface{})["Orchestrator"].(map[string]interface{})["Enabled"].(bool)
s.Require().Truef(orchestratorEnabled, "Expected orchestrator to be enabled, got: %t", orchestratorEnabled)
}

Expand Down
5 changes: 3 additions & 2 deletions test_integration/2_orchestrator_config_override_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package test_integration
import (
"context"
"fmt"
"github.com/google/uuid"
"github.com/stretchr/testify/suite"
"strings"
"testing"

"github.com/google/uuid"
"github.com/stretchr/testify/suite"
)

type OrchestratorConfigOverrideSuite struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package test_integration
import (
"context"
"fmt"
"github.com/google/uuid"
"github.com/stretchr/testify/suite"
"strings"
"testing"

"github.com/google/uuid"
"github.com/stretchr/testify/suite"
)

type OrchestratorConfigOverrideAndFlagSuite struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package test_integration
import (
"context"
"fmt"
"github.com/google/uuid"
"github.com/stretchr/testify/suite"
"strings"
"testing"

"github.com/google/uuid"
"github.com/stretchr/testify/suite"
)

type OrchestratorConfigOverrideAndFlagAndConfigFlagSuite struct {
Expand Down Expand Up @@ -67,7 +68,7 @@ func (s *OrchestratorConfigOverrideAndFlagAndConfigFlagSuite) TestConfigOverride
unmarshalledAgentOutput, err := s.unmarshalJSONString(agentConfigOutput, JSONObject)
s.Require().NoErrorf(err, "Error unmarshalling response: %q", err)

webuiEnabled := unmarshalledAgentOutput.(map[string]interface{})["WebUI"].(map[string]interface{})["Enabled"].(bool)
webuiEnabled := unmarshalledAgentOutput.(map[string]interface{})["config"].(map[string]interface{})["WebUI"].(map[string]interface{})["Enabled"].(bool)
s.Require().Truef(webuiEnabled, "Expected orchestrator to be enabled, got: %t", webuiEnabled)
}

Expand Down
7 changes: 4 additions & 3 deletions test_integration/5_orchestrator_no_config_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package test_integration

import (
"context"
"github.com/google/uuid"
"github.com/stretchr/testify/suite"
"strings"
"testing"

"github.com/google/uuid"
"github.com/stretchr/testify/suite"
)

type OrchestratorNoConfigSuite struct {
Expand Down Expand Up @@ -56,7 +57,7 @@ func (s *OrchestratorNoConfigSuite) TestStartingOrchestratorNodeWithConfigFile()
unmarshalledOutput, err := s.unmarshalJSONString(agentConfigOutput, JSONObject)
s.Require().NoErrorf(err, "Error unmarshalling response: %q", err)

unmarshalledOutputMap := unmarshalledOutput.(map[string]interface{})
unmarshalledOutputMap := unmarshalledOutput.(map[string]interface{})["config"].(map[string]interface{})

orchestratorEnabled := unmarshalledOutputMap["Orchestrator"].(map[string]interface{})["Enabled"].(bool)
s.Require().Truef(orchestratorEnabled, "Expected orchestrator to be enabled, got: %t", orchestratorEnabled)
Expand Down
7 changes: 4 additions & 3 deletions test_integration/6_jobs_basic_runs_scenarios_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package test_integration

import (
"bacalhau/integration_tests/utils"
"context"
"fmt"
"github.com/google/uuid"
"github.com/stretchr/testify/suite"
"strings"
"testing"
"time"

"bacalhau/integration_tests/utils"
"github.com/google/uuid"
"github.com/stretchr/testify/suite"
)

type JobsBasicRunsScenariosSuite struct {
Expand Down

0 comments on commit fe291ae

Please sign in to comment.