From 2a2689ade4fad6b5a53161d058afea3da685eea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Tue, 11 Jun 2024 11:55:36 -0500 Subject: [PATCH 1/7] Ensure correct pool is being used for PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Pereira --- .../workflows/tests-integration-reusable.yml | 88 +++++++------------ .github/workflows/tests-integration.yml | 44 +++++++--- 2 files changed, 63 insertions(+), 69 deletions(-) diff --git a/.github/workflows/tests-integration-reusable.yml b/.github/workflows/tests-integration-reusable.yml index 6239c51dc38..33f5fc100e1 100644 --- a/.github/workflows/tests-integration-reusable.yml +++ b/.github/workflows/tests-integration-reusable.yml @@ -22,6 +22,15 @@ on: name: required: true type: string + pool-name: + type: string + default: ${{ vars.SHEPHERD_POOL_NAME }} + pool-namespace: + type: string + default: 'official' + is-pr: + type: boolean + default: true jobs: run-integration-tests: @@ -32,7 +41,7 @@ jobs: container: us-west2-docker.pkg.dev/shepherd-268822/shepherd2/concourse-resource:latest steps: - uses: LouisBrunner/checks-action@v2.0.0 - if: always() + if: always() && inputs.is-pr id: check with: token: ${{ secrets.GITHUB_TOKEN }} @@ -86,12 +95,14 @@ jobs: name: Claim Environment env: account_token: ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }} - pool_name: ${{ vars.SHEPHERD_POOL_NAME }} + pool_name: ${{ inputs.pool-name }} + pool_namespace: ${{ inputs.pool-namespace }} run: | shepherd login service-account ${account_token} - lease_id=$(shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace official --namespace tas-devex --json | jq -r .id) - # Give somtime for the lease to complete. Shepherd may take upto an 3 hours to create an env + echo "shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace ${pool_namespace} --namespace tas-devex" + lease_id=$(shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace ${pool_namespace} --namespace tas-devex --json | jq -r .id) + # Give sometime for the lease to complete. Shepherd may take upto an 3 hours to create an env # if the pool is empty. count=0 while [ $count -lt 360 ] ; do @@ -112,7 +123,7 @@ jobs: env_name=$(jq -r .name metadata.json) cat metadata.json | jq -r '.name' echo "lease-id=$lease_id" >> "${GITHUB_OUTPUT}" - + - name: Install Tools run: | if [[ ${{ inputs.os }} =~ "windows" ]] @@ -171,57 +182,24 @@ jobs: - name: Deploy MIN CAPI with Isolation Segment and OIDC Provider if: ${{ inputs.capi-version != 'edge' }} run: | - # TODO: Make this actually deploy min capi - # Creates vars files - mkdir vars-files - echo "cs = ${{ secrets.CLIENT_SECRET }}" - cat << EOF > vars-files/vars.yml - client-secret: ${{ secrets.CLIENT_SECRET }} - EOF - - # Copy Ops files - mkdir ops-files - cp cf-deployment/operations/test/add-persistent-isolation-segment-diego-cell.yml ops-files/ - cp cli-ci/ci/infrastructure/operations/add-oidc-provider.yml ops-files/ - cp cli-ci/ci/infrastructure/operations/add-uaa-client-credentials.yml ops-files/ - cp cli-ci/ci/infrastructure/operations/diego-cell-instances.yml ops-files/ - cp cli-ci/ci/infrastructure/operations/use-latest-ruby-buildpack.yml ops-files/ - - # Deletes CF-D env_name=$(jq -r .name metadata.json) jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${env_name}.priv eval "$(bbl print-env --metadata-file metadata.json)" - bosh -d cf delete-deployment -n - - # Deploy CF-D - mkdir toolsmiths-env - cp metadata.json toolsmiths-env/metadata - cat metadata.json | jq -r .name > toolsmiths-env/name - export VARS_FILES="vars.yml" - export MANIFEST_FILE="cf-deployment.yml" - export SYSTEM_DOMAIN="" - export REGENERATE_CREDENTIALS=false - export DEPLOY_WITH_UPTIME_MEASUREMENTS=false - export MEASURE_SYSLOG_AVAILABILITY=false - export TCP_DOMAIN="" - export AVAILABLE_PORT="" - export FAIL_ON_DOWNTIME=false - export APP_PUSHABILITY_THRESHOLD=0 - export HTTP_AVAILABILITY_THRESHOLD=0 - export RECENT_LOGS_THRESHOLD=0 - export STREAMING_LOGS_THRESHOLD=0 - export APP_SYSLOG_AVAILABILITY_THRESHOLD=0 - export USE_SINGLE_APP_INSTANCE=false - export BOSH_DEPLOY_ARGS="" - export BOSH_LITE=false - export BBL_JSON_CONFIG="" - export SKIP_STEMCELL_UPLOAD=false - export OPS_FILES="add-persistent-isolation-segment-diego-cell.yml \ - add-uaa-client-credentials.yml \ - diego-cell-instances.yml \ - add-oidc-provider.yml \ - use-latest-ruby-buildpack.yml" - ./cf-deployment-concourse-tasks/bosh-deploy/task + + # deploy + bosh -d cf manifest > /tmp/manifest.yml + bosh interpolate /tmp/manifest.yml \ + -o cf-deployment/operations/test/add-persistent-isolation-segment-diego-cell.yml \ + -o cli-ci/ci/infrastructure/operations/add-oidc-provider.yml \ + -o cli-ci/ci/infrastructure/operations/add-uaa-client-credentials.yml \ + -o cli-ci/ci/infrastructure/operations/diego-cell-instances.yml \ + -o cli-ci/ci/infrastructure/operations/use-latest-ruby-buildpack.yml \ + -v client-secret="${{ secrets.CLIENT_SECRET }}" \ + > ./director.yml + + bosh -d cf deploy director.yml -n + echo "Deployed CAPI version:" + bosh -d cf releases | grep capi - name: Set Up Go uses: actions/setup-go@v5 @@ -294,9 +272,9 @@ jobs: shepherd login service-account ${account_token} set -x shepherd delete lease ${{ steps.claim-env.outputs.lease-id }} --namespace tas-devex - + - uses: LouisBrunner/checks-action@v2.0.0 - if: always() + if: always() && inputs.is-pr with: token: ${{ secrets.GITHUB_TOKEN }} check_id: ${{ steps.check.outputs.check_id }} diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index b49c93963c7..7f396b3108e 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -4,6 +4,17 @@ run-name: "Integration [${{ github.event.workflow_run.head_branch }}]: ${{ githu on: workflow_dispatch: + inputs: + workflow: + description: Tests to run + required: true + type: choice + options: + - run-integration-tests-cf-env + - run-integration-tests-cf-env-with-client-creds + - run-integration-tests-cf-env-with-min-capi + # - run-integration-windows + # - run-integration-windows-client-credentials workflow_run: workflows: - "Tests" @@ -13,40 +24,45 @@ on: jobs: run-integration-tests-cf-env: name: Integration tests - if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-tests-cf-env') || github.event.workflow_run.conclusion == 'success' }} uses: ./.github/workflows/tests-integration-reusable.yml with: capi-version: edge run-with-client-creds: false os: ubuntu-latest name: Integration + is-pr: ${{ github.event_name != 'workflow_dispatch' }} secrets: inherit run-integration-tests-cf-env-with-client-creds: name: client creds - if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-tests-cf-env-with-client-creds') || github.event.workflow_run.conclusion == 'success' }} uses: ./.github/workflows/tests-integration-reusable.yml with: capi-version: edge run-with-client-creds: true os: ubuntu-latest name: Integration client creds + is-pr: ${{ github.event_name != 'workflow_dispatch' }} secrets: inherit - # run-integration-tests-cf-env-with-min-capi: - # name: MIN CAPI - # # if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} - # uses: ./.github/workflows/tests-integration-reusable.yml - # with: - # capi-version: min - # run-with-client-creds: false - # os: ubuntu-latest - # name: Integration MIN CAPI - # secrets: inherit + run-integration-tests-cf-env-with-min-capi: + name: MIN CAPI + if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-tests-cf-env-with-min-capi') || github.event.workflow_run.conclusion == 'success' }} + uses: ./.github/workflows/tests-integration-reusable.yml + with: + capi-version: min + run-with-client-creds: false + os: ubuntu-latest + name: Integration MIN CAPI + pool-name: cfd_16_11_0 + pool-namespace: tas-devex + is-pr: ${{ github.event_name != 'workflow_dispatch' }} + secrets: inherit #run-integration-windows: # name: Windows - # if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + # if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-windows') || github.event.workflow_run.conclusion == 'success' }} # uses: ./.github/workflows/tests-integration-reusable.yml # with: # capi-version: edge @@ -57,7 +73,7 @@ jobs: #run-integration-windows-client-credentials: # name: Windows with client credentials - # if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + # if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-windows-client-credentials') || github.event.workflow_run.conclusion == 'success' }} # uses: ./.github/workflows/tests-integration-reusable.yml # with: # capi-version: edge From 6f1ede01810638bde69a01630eac12b1245ce4ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Tue, 11 Jun 2024 11:56:44 -0500 Subject: [PATCH 2/7] Use integration workflow directly from unit tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Pereira --- .../workflows/tests-integration-reusable.yml | 25 ------------------ .github/workflows/tests-integration.yml | 26 ++++++++----------- .github/workflows/tests-unit.yml | 10 +++++++ 3 files changed, 21 insertions(+), 40 deletions(-) diff --git a/.github/workflows/tests-integration-reusable.yml b/.github/workflows/tests-integration-reusable.yml index 33f5fc100e1..9839eb1c0f7 100644 --- a/.github/workflows/tests-integration-reusable.yml +++ b/.github/workflows/tests-integration-reusable.yml @@ -28,10 +28,6 @@ on: pool-namespace: type: string default: 'official' - is-pr: - type: boolean - default: true - jobs: run-integration-tests: defaults: @@ -40,17 +36,6 @@ jobs: runs-on: ${{ inputs.os }} container: us-west2-docker.pkg.dev/shepherd-268822/shepherd2/concourse-resource:latest steps: - - uses: LouisBrunner/checks-action@v2.0.0 - if: always() && inputs.is-pr - id: check - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: "${{ inputs.name }}" - status: in_progress - sha: ${{github.event.workflow_run.head_sha}} - output: | - {"title": "${{ inputs.name }}", "summary":"started ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"} - - name: Checkout cli uses: actions/checkout@v4 with: @@ -272,13 +257,3 @@ jobs: shepherd login service-account ${account_token} set -x shepherd delete lease ${{ steps.claim-env.outputs.lease-id }} --namespace tas-devex - - - uses: LouisBrunner/checks-action@v2.0.0 - if: always() && inputs.is-pr - with: - token: ${{ secrets.GITHUB_TOKEN }} - check_id: ${{ steps.check.outputs.check_id }} - conclusion: ${{ job.status }} - sha: ${{github.event.workflow_run.head_sha}} - output: | - {"title": "${{ inputs.name }}", "summary":"finished ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"} diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index 7f396b3108e..a19db18c1d2 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -3,6 +3,11 @@ name: "Tests: Integration" run-name: "Integration [${{ github.event.workflow_run.head_branch }}]: ${{ github.event.workflow_run.head_commit.message }}" on: + workflow_call: + inputs: + workflow: + default: all + type: string workflow_dispatch: inputs: workflow: @@ -15,40 +20,32 @@ on: - run-integration-tests-cf-env-with-min-capi # - run-integration-windows # - run-integration-windows-client-credentials - workflow_run: - workflows: - - "Tests" - types: - - completed - -jobs: +jobs: run-integration-tests-cf-env: name: Integration tests - if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-tests-cf-env') || github.event.workflow_run.conclusion == 'success' }} + if: ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env' }} uses: ./.github/workflows/tests-integration-reusable.yml with: capi-version: edge run-with-client-creds: false os: ubuntu-latest name: Integration - is-pr: ${{ github.event_name != 'workflow_dispatch' }} secrets: inherit run-integration-tests-cf-env-with-client-creds: name: client creds - if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-tests-cf-env-with-client-creds') || github.event.workflow_run.conclusion == 'success' }} + if: ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-client-creds' }} uses: ./.github/workflows/tests-integration-reusable.yml with: capi-version: edge run-with-client-creds: true os: ubuntu-latest name: Integration client creds - is-pr: ${{ github.event_name != 'workflow_dispatch' }} secrets: inherit run-integration-tests-cf-env-with-min-capi: name: MIN CAPI - if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-tests-cf-env-with-min-capi') || github.event.workflow_run.conclusion == 'success' }} + if: ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-min-capi' }} uses: ./.github/workflows/tests-integration-reusable.yml with: capi-version: min @@ -57,12 +54,11 @@ jobs: name: Integration MIN CAPI pool-name: cfd_16_11_0 pool-namespace: tas-devex - is-pr: ${{ github.event_name != 'workflow_dispatch' }} secrets: inherit #run-integration-windows: # name: Windows - # if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-windows') || github.event.workflow_run.conclusion == 'success' }} + # if: ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-windows' }} # uses: ./.github/workflows/tests-integration-reusable.yml # with: # capi-version: edge @@ -73,7 +69,7 @@ jobs: #run-integration-windows-client-credentials: # name: Windows with client credentials - # if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-windows-client-credentials') || github.event.workflow_run.conclusion == 'success' }} + # if: ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-windows-client-credentials' }} # uses: ./.github/workflows/tests-integration-reusable.yml # with: # capi-version: edge diff --git a/.github/workflows/tests-unit.yml b/.github/workflows/tests-unit.yml index 51b23b8132c..0301a89b4ee 100644 --- a/.github/workflows/tests-unit.yml +++ b/.github/workflows/tests-unit.yml @@ -84,4 +84,14 @@ jobs: Get-Item Makefile make units + + + integration: + needs: + - units + - units-windows + name: Integration tests + if: ${{ github.event != 'workflow_dispatch' }} + uses: ./.github/workflows/tests-integration.yml + secrets: inherit # vim: set sw=2 ts=2 sts=2 et tw=78 foldlevel=2 fdm=indent nospell: From 74d334ed8f0114ef43489070aec17e4bba3498bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Thu, 13 Jun 2024 10:00:15 -0500 Subject: [PATCH 3/7] Provide secret directly instead of using env variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Pereira --- .github/workflows/tests-integration-reusable.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests-integration-reusable.yml b/.github/workflows/tests-integration-reusable.yml index 9839eb1c0f7..cff651d035c 100644 --- a/.github/workflows/tests-integration-reusable.yml +++ b/.github/workflows/tests-integration-reusable.yml @@ -142,8 +142,6 @@ jobs: - name: Deploy Isolation Segment and OIDC Provider if: ${{ inputs.capi-version == 'edge' }} - env: - CF_INT_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} run: | env_name=$(jq -r .name metadata.json) jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${env_name}.priv @@ -157,7 +155,7 @@ jobs: -o cli-ci/ci/infrastructure/operations/add-oidc-provider.yml \ -o cli-ci/ci/infrastructure/operations/add-uaa-client-credentials.yml \ -o cli-ci/ci/infrastructure/operations/diego-cell-instances.yml \ - -v client-secret="${CF_INT_CLIENT_SECRET}" \ + -v client-secret="${{ secrets.CLIENT_SECRET }}" \ > ./director.yml bosh -d cf deploy director.yml -n From 867d09c0b69bf0ed1ec5748b00420951bb12dfe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Tue, 18 Jun 2024 12:08:59 -0500 Subject: [PATCH 4/7] Remove check for Server header in curl request tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Starting on version 1.181.0, capi will no longer report the version of the nginx server to ensure that no information is leaked. For more information check https://github.com/cloudfoundry/capi-release/pull/406 Signed-off-by: João Pereira --- integration/v7/isolated/curl_command_test.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/integration/v7/isolated/curl_command_test.go b/integration/v7/isolated/curl_command_test.go index 5cc7f01d5bd..b6d3889aaea 100644 --- a/integration/v7/isolated/curl_command_test.go +++ b/integration/v7/isolated/curl_command_test.go @@ -8,7 +8,6 @@ import ( "strings" . "code.cloudfoundry.org/cli/cf/util/testhelpers/matchers" - "code.cloudfoundry.org/cli/integration/helpers" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -57,11 +56,9 @@ var _ = Describe("curl command", func() { var ExpectResponseHeaders = func(session *Session) { Eventually(session).Should(Say("HTTP/1.1 200 OK")) - Eventually(session).Should(Say(`Connection: .+`)) Eventually(session).Should(Say(`Content-Length: .+`)) Eventually(session).Should(Say(`Content-Type: .+`)) Eventually(session).Should(Say(`Date: .+`)) - Eventually(session).Should(Say(`Server: .+`)) Eventually(session).Should(Say(`X-Content-Type-Options: .+`)) Eventually(session).Should(Say(`X-Vcap-Request-Id: .+`)) } @@ -386,7 +383,7 @@ var _ = Describe("curl command", func() { }) When("--output is passed with a file name", func() { - It("writes the response body to the file but the other output to stdout", func() { + It("writes the response headers and body to the file", func() { outFile, err := os.CreateTemp("", "output*.json") Expect(err).ToNot(HaveOccurred()) session := helpers.CF("curl", "/v2/apps", "-i", "--output", outFile.Name()) @@ -394,7 +391,19 @@ var _ = Describe("curl command", func() { ExpectResponseHeaders(session) body, err := os.ReadFile(outFile.Name()) Expect(err).ToNot(HaveOccurred()) - Expect(string(body)).To(MatchJSON(expectedJSON)) + + contents := string(body) + jsonStartsAt := strings.Index(contents, "{") + + Expect(contents).To(ContainSubstring("HTTP/1.1 200 OK")) + Expect(contents).To(MatchRegexp(`Content-Length: .+`)) + Expect(contents).To(MatchRegexp(`Content-Type: .+`)) + Expect(contents).To(MatchRegexp(`Date: .+`)) + Expect(contents).To(MatchRegexp(`X-Content-Type-Options: .+`)) + Expect(contents).To(MatchRegexp(`X-Vcap-Request-Id: .+`)) + + actualJSON := contents[jsonStartsAt:] + Expect(actualJSON).To(MatchJSON(expectedJSON)) }) When("--output is passed and CF_TRACE is set to a file", func() { From e0f882bd7eedf7ebfa886f07cd2dc42736a6456b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Tue, 18 Jun 2024 14:46:09 -0500 Subject: [PATCH 5/7] Change in response from UAA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Starting on version 76.26.0 of UAA a change was made that changes the behavior more context in https://github.com/cloudfoundry/uaa/issues/2545 Signed-off-by: João Pereira --- api/uaa/error_converter.go | 2 +- api/uaa/error_converter_test.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/api/uaa/error_converter.go b/api/uaa/error_converter.go index ebbe950caee..c5ecb299214 100644 --- a/api/uaa/error_converter.go +++ b/api/uaa/error_converter.go @@ -53,7 +53,7 @@ func convert(rawHTTPStatusErr RawHTTPStatusError) error { if uaaErrorResponse.Type == "invalid_token" { return InvalidAuthTokenError{Message: uaaErrorResponse.Description} } - if uaaErrorResponse.Type == "unauthorized" { + if uaaErrorResponse.Type == "unauthorized" || uaaErrorResponse.Type == "invalid_client" { if uaaErrorResponse.Description == "Your account has been locked because of too many failed attempts to login." { return AccountLockedError{Message: "Your account has been locked because of too many failed attempts to login."} } diff --git a/api/uaa/error_converter_test.go b/api/uaa/error_converter_test.go index 8d8a03432d9..a3fb6596904 100644 --- a/api/uaa/error_converter_test.go +++ b/api/uaa/error_converter_test.go @@ -135,6 +135,22 @@ var _ = Describe("Error Wrapper", func() { }) }) + Context("invalid_client with bad credentials", func() { + BeforeEach(func() { + fakeConnectionErr.RawResponse = []byte(`{ + "error": "invalid_client", + "error_description": "Bad credentials" +}`) + fakeConnection.MakeReturns(fakeConnectionErr) + }) + + It("returns a BadCredentialsError", func() { + Expect(fakeConnection.MakeCallCount()).To(Equal(1)) + + Expect(makeErr).To(MatchError(UnauthorizedError{Message: "Bad credentials"})) + }) + }) + Context("unauthorized - too many failed login attempts", func() { BeforeEach(func() { fakeConnectionErr.RawResponse = []byte(`{ From ebbb356589e4ae68fb07336c86c042bef531eded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Thu, 20 Jun 2024 10:07:12 -0500 Subject: [PATCH 6/7] Revert min-capi tests introduction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Pereira --- .github/workflows/tests-integration.yml | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index a19db18c1d2..db0fc752224 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -17,7 +17,7 @@ on: options: - run-integration-tests-cf-env - run-integration-tests-cf-env-with-client-creds - - run-integration-tests-cf-env-with-min-capi + # - run-integration-tests-cf-env-with-min-capi # - run-integration-windows # - run-integration-windows-client-credentials jobs: @@ -43,18 +43,18 @@ jobs: name: Integration client creds secrets: inherit - run-integration-tests-cf-env-with-min-capi: - name: MIN CAPI - if: ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-min-capi' }} - uses: ./.github/workflows/tests-integration-reusable.yml - with: - capi-version: min - run-with-client-creds: false - os: ubuntu-latest - name: Integration MIN CAPI - pool-name: cfd_16_11_0 - pool-namespace: tas-devex - secrets: inherit + #run-integration-tests-cf-env-with-min-capi: + # name: MIN CAPI + # if: ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-min-capi' }} + # uses: ./.github/workflows/tests-integration-reusable.yml + # with: + # capi-version: min + # run-with-client-creds: false + # os: ubuntu-latest + # name: Integration MIN CAPI + # pool-name: cfd_16_11_0 + # pool-namespace: tas-devex + # secrets: inherit #run-integration-windows: # name: Windows From 880069e2085ac62051d239d914818dfb2b6745f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Tue, 25 Jun 2024 17:09:46 -0500 Subject: [PATCH 7/7] Incorrect merge of cherry-pick MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Pereira --- integration/v7/isolated/curl_command_test.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/integration/v7/isolated/curl_command_test.go b/integration/v7/isolated/curl_command_test.go index b6d3889aaea..cef5f0d4a5d 100644 --- a/integration/v7/isolated/curl_command_test.go +++ b/integration/v7/isolated/curl_command_test.go @@ -391,19 +391,7 @@ var _ = Describe("curl command", func() { ExpectResponseHeaders(session) body, err := os.ReadFile(outFile.Name()) Expect(err).ToNot(HaveOccurred()) - - contents := string(body) - jsonStartsAt := strings.Index(contents, "{") - - Expect(contents).To(ContainSubstring("HTTP/1.1 200 OK")) - Expect(contents).To(MatchRegexp(`Content-Length: .+`)) - Expect(contents).To(MatchRegexp(`Content-Type: .+`)) - Expect(contents).To(MatchRegexp(`Date: .+`)) - Expect(contents).To(MatchRegexp(`X-Content-Type-Options: .+`)) - Expect(contents).To(MatchRegexp(`X-Vcap-Request-Id: .+`)) - - actualJSON := contents[jsonStartsAt:] - Expect(actualJSON).To(MatchJSON(expectedJSON)) + Expect(string(body)).To(MatchJSON(expectedJSON)) }) When("--output is passed and CF_TRACE is set to a file", func() {