From 953eb330a9196f3ccd439cbedc6e13f9fcf57e7f Mon Sep 17 00:00:00 2001 From: Roey Berman Date: Tue, 17 Sep 2024 07:29:31 -0700 Subject: [PATCH] Use stable CLI for tests (#1637) Addressing a TODO I put in the code when working on Nexus while it wasn't available in a stable server / CLI release. Also: - Use dashes instead of underscores in the test endpoint names since that logic changed since the server RC was cut. - [Enable 1.25.0 tests with docker-compose](https://github.com/temporalio/sdk-go/pull/1637/commits/719c86a665adcee0f7cb3f1acae74b2c4bcd4453) --- .github/workflows/ci.yml | 9 +-------- .github/workflows/docker/docker-compose.override.yaml | 6 +++++- .github/workflows/docker/dynamic-config-custom.yaml | 9 +++++++++ internal/cmd/build/main.go | 3 +-- test/nexus_test.go | 3 +-- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11cf482c0..2b8d26c50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,13 +88,6 @@ jobs: - name: Docker compose - integration tests if: ${{ matrix.testDockerCompose }} run: go run . integration-test - env: - # TODO(bergundy): Remove this flag once server 1.25.0 is out. - DISABLE_NEXUS_TESTS: "1" - # TODO(bergundy): Remove this flag too once server 1.25.0 is out. Thanks Roey! :) - DISABLE_BACKLOG_STATS_TESTS: "1" - # TODO(cretz): Remove this flag once server 1.25.0 is out. - DISABLE_USER_METADATA_TESTS: "1" working-directory: ./internal/cmd/build cloud-test: @@ -132,4 +125,4 @@ jobs: with: go-repo-path: ${{github.event.pull_request.head.repo.full_name}} version: ${{github.event.pull_request.head.ref}} - version-is-repo-ref: true \ No newline at end of file + version-is-repo-ref: true diff --git a/.github/workflows/docker/docker-compose.override.yaml b/.github/workflows/docker/docker-compose.override.yaml index f70c0eaa5..30d545964 100644 --- a/.github/workflows/docker/docker-compose.override.yaml +++ b/.github/workflows/docker/docker-compose.override.yaml @@ -1,4 +1,8 @@ services: temporal: environment: - - DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/dynamic-config-custom.yaml \ No newline at end of file + - DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/dynamic-config-custom.yaml + - FRONTEND_HTTP_PORT=7243 + ports: + - 7233:7233 + - 7243:7243 diff --git a/.github/workflows/docker/dynamic-config-custom.yaml b/.github/workflows/docker/dynamic-config-custom.yaml index 7a9fe5d2e..df96b6937 100644 --- a/.github/workflows/docker/dynamic-config-custom.yaml +++ b/.github/workflows/docker/dynamic-config-custom.yaml @@ -21,3 +21,12 @@ worker.buildIdScavengerEnabled: - value: true worker.removableBuildIdDurationSinceDefault: - value: 1 +system.enableNexus: + - value: true +component.nexusoperations.callback.endpoint.template: + - value: http://localhost:7243/namespaces/{{.NamespaceName}}/nexus/callback +# SDK tests use arbitrary callback URLs, permit that on the server. +component.callbacks.allowedAddresses: + - value: + - Pattern: "*" + AllowInsecure: true diff --git a/internal/cmd/build/main.go b/internal/cmd/build/main.go index 0a1a07fa9..500d25ab6 100644 --- a/internal/cmd/build/main.go +++ b/internal/cmd/build/main.go @@ -140,9 +140,8 @@ func (b *builder) integrationTest() error { HostPort: "127.0.0.1:7233", Namespace: "integration-test-namespace", }, - // TODO(bergundy): Remove this override after server 1.25.0 is released. CachedDownload: testsuite.CachedDownload{ - Version: "v0.14.0-nexus.0", + Version: "v1.1.0", }, LogLevel: "warn", ExtraArgs: []string{ diff --git a/test/nexus_test.go b/test/nexus_test.go index c9f653abe..f08925c2c 100644 --- a/test/nexus_test.go +++ b/test/nexus_test.go @@ -29,7 +29,6 @@ import ( "net/http" "os" "slices" - "strings" "testing" "time" @@ -77,7 +76,7 @@ func newTestContext(t *testing.T, ctx context.Context) *testContext { require.NoError(t, err) taskQueue := "sdk-go-nexus-test-tq-" + uuid.NewString() - endpoint := strings.ReplaceAll("sdk-go-nexus-test-ep-"+uuid.NewString(), "-", "_") + endpoint := "sdk-go-nexus-test-ep-" + uuid.NewString() res, err := c.OperatorService().CreateNexusEndpoint(ctx, &operatorservice.CreateNexusEndpointRequest{ Spec: &nexuspb.EndpointSpec{ Name: endpoint,