Skip to content

Commit

Permalink
Point back to prod, update vc data sources test
Browse files Browse the repository at this point in the history
  • Loading branch information
7imon7ays committed Jul 23, 2024
1 parent 583bfd0 commit fc87ee8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/provider/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

// HostURL - Default Warpstream URL.
const HostURL string = "https://staging-a.us-east-1.warpstream.com/api/v1" // todo simon: temp
const HostURL string = "https://api.prod.us-east-1.warpstream.com/api/v1"

// Client.
type Client struct {
Expand Down
5 changes: 5 additions & 0 deletions internal/provider/virtual_cluster_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ func testAccVCDataSourceCheck_byoc(name string) resource.TestCheckFunc {
resource.TestCheckResourceAttr(
"data.warpstream_virtual_cluster.test", "agent_keys.0.name", "akn_virtual_cluster_default_7695dba1efaa",
),
utils.TestCheckResourceAttrEndsWith(
"data.warpstream_virtual_cluster.test",
"bootstrap_url",
".kafka.discoveryv2.prod-z.us-east-1.warpstream.com:9092",
),
testAccVCDataSourceCheck(name),
)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/provider/virtual_cluster_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ func testAccVirtualClusterResourceCheck_BYOC(acls bool, autoTopic bool, numParts
testAccVirtualClusterResourceCheck(acls, autoTopic, numParts, "byoc"),
resource.TestCheckResourceAttr("warpstream_virtual_cluster.test", "agent_keys.#", "1"),
utils.TestCheckResourceAttrStartsWith("warpstream_virtual_cluster.test", "agent_keys.0.name", "akn_virtual_cluster_test_acc_"),
// todo simon: move back to prod url
utils.TestCheckResourceAttrEndsWith("warpstream_virtual_cluster.test", "bootstrap_url", ".kafka.discoveryv2.staging-a.us-east-1.warpstream.com:9092"),
utils.TestCheckResourceAttrEndsWith("warpstream_virtual_cluster.test", "bootstrap_url", ".kafka.discoveryv2.prod-z.us-east-1.warpstream.com:9092"),
)
}

Expand Down
20 changes: 20 additions & 0 deletions internal/provider/virtual_clusters_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ func assertBYOCVC(vcs []map[string]string, name string) error {
return fmt.Errorf("Expected agent key virtual cluster ID to be 'vci_daf191a9_47fa_4215_aa49_2e74c5ba78d9', got %s", agentKeysVCIDAttr)
}

burl, ok := vc["bootstrap_url"]

if !ok {
return fmt.Errorf("Expected byoc virtual cluster JSON to have a bootstrap URL field")
}

expectedBurl := "api-18b7339a-6bc0-4397-a066-d3bddb4f8392.kafka.discoveryv2.prod-z.us-east-1.warpstream.com:9092"

if burl != expectedBurl {
return fmt.Errorf(
"Expected vcn_wtf byoc cluster bootstrap URL to be %s, got %s",
expectedBurl,
vc["bootstrap_url"],
)
}

return nil
}

Expand All @@ -126,6 +142,10 @@ func assertServerlessVC(vcs []map[string]string, name string) error {
)
}

if _, ok := vc["bootstrap_url"]; ok {
return fmt.Errorf("Serverless virtual cluster should not have a bootstrap URL field")
}

return nil
}

Expand Down

0 comments on commit fc87ee8

Please sign in to comment.