diff --git a/.github/ops-files/diego-cell-instances.yml b/.github/ops-files/diego-cell-instances.yml index 19ea43d8077..6fff5cd2232 100644 --- a/.github/ops-files/diego-cell-instances.yml +++ b/.github/ops-files/diego-cell-instances.yml @@ -2,3 +2,7 @@ - type: replace path: /instance_groups/name=diego-cell/instances value: 4 + +- type: replace + path: /instance_groups/name=isolated-diego-cell/jobs/name=rep/properties?/set_kernel_parameters + value: false diff --git a/.github/workflows/release-build-sign-upload.yml b/.github/workflows/release-build-sign-upload.yml index 911a1348a32..84e6ed2895b 100644 --- a/.github/workflows/release-build-sign-upload.yml +++ b/.github/workflows/release-build-sign-upload.yml @@ -38,9 +38,18 @@ run-name: "Release: Build Sign Upload [${{ github.ref_name }}]" on: workflow_dispatch: + inputs: + release_version: + description: 'Release version bump' + required: true + default: 'patch' + type: choice + options: + - minor + - patch permissions: - contents: read + contents: write defaults: run: @@ -50,39 +59,56 @@ jobs: setup: name: Setup runs-on: ubuntu-latest - + env: + VERSION_MAJOR: 8 outputs: - aws-s3-bucket: "v${{ steps.parse-semver.outputs.version-major }}-cf-cli-releases" + aws-s3-bucket: "v${{ steps.bump-version.outputs.version-major }}-cf-cli-releases" - version-build: ${{ steps.parse-semver.outputs.version-build }} - version-major: ${{ steps.parse-semver.outputs.version-major }} - version-minor: ${{ steps.parse-semver.outputs.version-minor }} - version-patch: ${{ steps.parse-semver.outputs.version-patch }} + version-build: ${{ steps.bump-version.outputs.version-build }} + version-major: ${{ env.VERSION_MAJOR }} + version-minor: ${{ steps.bump-version.outputs.version-minor }} + version-patch: ${{ steps.bump-version.outputs.version-patch }} steps: - name: Checkout cli uses: actions/checkout@v4 - - - name: Check if VERSION_BUILD matches tag ${{ github.ref }} + + - name: Bump version + id: bump-version run: | - echo "Git Ref: ${{ github.ref }}" - echo "VERSION_BUILD: $(cat BUILD_VERSION)" + set -x + git fetch --tags --quiet + latest_tag="$(git tag | sort -V | grep v${VERSION_MAJOR} | tail -1)" + echo "Latest tag is ${latest_tag}" - exit 0 + version="${latest_tag#[vV]}" - - name: Parse semver - id: parse-semver - run: | - VERSION=$(cat BUILD_VERSION) - VERSION="${VERSION#[vV]}" + version_minor="${version#*.}" + version_minor="${version_minor%.*}" + version_patch=${version##*.} - VERSION_MINOR="${VERSION#*.}" - VERSION_MINOR="${VERSION_MINOR%.*}" + if [ "${{ inputs.release_version }}" == "minor" ]; then + version_minor=$(($version_minor + 1)) + version_patch=0 + else + version_patch=$(($version_patch + 1)) + fi - echo "version-build=${VERSION}" >> "${GITHUB_OUTPUT}" - echo "version-major=${VERSION%%\.*}" >> "${GITHUB_OUTPUT}" - echo "version-minor=${VERSION_MINOR}" >> "${GITHUB_OUTPUT}" - echo "version-patch=${VERSION##*.}" >> "${GITHUB_OUTPUT}" + new_version="${VERSION_MAJOR}.${version_minor}.${version_patch}" + echo "new version is ${new_version}" + + echo "version-build=${new_version}" >> "${GITHUB_OUTPUT}" + echo "version-minor=${version_minor}" >> "${GITHUB_OUTPUT}" + echo "version-patch=${version_patch}" >> "${GITHUB_OUTPUT}" + + - name: Publish Tag + run: | + new_tag="v${{ steps.bump-version.outputs.version-build }}" + echo "new version is $new_tag" + git config user.name "GitHub Actions" + git config user.email "github-actions@users.noreply.github.com" + git tag -am "Bump cli version ${new_tag}" ${new_tag} + git push origin $new_tag build-linux: name: Build Linux @@ -135,6 +161,8 @@ jobs: ${{ runner.os }}-go- - name: Build Linux + env: + CF_BUILD_VERSION: ${VERSION_BUILD} run: | make out/cf-cli_linux_i686 make out/cf-cli_linux_x86-64 @@ -252,7 +280,6 @@ jobs: name: cf-cli-linux-rpm-packages path: signed-redhat-installer/*.rpm - - name: Build Debian Packages env: VERSION_BUILD: ${{ needs.setup.outputs.version-build }} @@ -431,6 +458,8 @@ jobs: ${{ runner.os }}-go- - name: Build macOS Binaries + env: + CF_BUILD_VERSION: ${VERSION_BUILD} run: | make out/cf-cli_osx make out/cf-cli_macosarm @@ -610,6 +639,8 @@ jobs: go install github.com/akavel/rsrc@v0.10.2 - name: Build CF CLI for Windows + env: + CF_BUILD_VERSION: ${VERSION_BUILD} run: | Get-Command make Get-Item Makefile @@ -694,14 +725,12 @@ jobs: - name: Zip Windows artifact run: | - # strip leading v to go from tag -> semver - $installer_release_version="$(cat BUILD_VERSION)".Replace("v", "") pushd "${env:RUNNER_TEMP}\win32" - $installer_zip_filename="${env:RUNNER_TEMP}\cf${env:VERSION_MAJOR}-cli-installer_${installer_release_version}_win32.zip" + $installer_zip_filename="${env:RUNNER_TEMP}\cf${env:VERSION_MAJOR}-cli-installer_${env:VERSION_BUILD}_win32.zip" Compress-Archive -DestinationPath "$installer_zip_filename" -Path * popd pushd "${env:RUNNER_TEMP}\winx64" - $installer_zip_filename="${env:RUNNER_TEMP}\cf${env:VERSION_MAJOR}-cli-installer_${installer_release_version}_winx64.zip" + $installer_zip_filename="${env:RUNNER_TEMP}\cf${env:VERSION_MAJOR}-cli-installer_${env:VERSION_BUILD}_winx64.zip" Compress-Archive -DestinationPath "$installer_zip_filename" -Path * popd Get-ChildItem "${env:RUNNER_TEMP}" diff --git a/.github/workflows/release-update-repos.yml b/.github/workflows/release-update-repos.yml index 5d223e5fc79..a36ef277d4a 100644 --- a/.github/workflows/release-update-repos.yml +++ b/.github/workflows/release-update-repos.yml @@ -3,11 +3,6 @@ run-name: "Release: Update Repositories [${{ github.ref_name }}]" on: workflow_dispatch: - inputs: - build_version: - description: 'build version format: n.n.n' - required: true - type: string permissions: contents: write @@ -20,21 +15,16 @@ jobs: setup: name: Setup runs-on: ubuntu-latest - if: ${{ github.action_repository != 'cloudfoundry/cli' }} + env: + VERSION_MAJOR: 8 outputs: - secrets-environment: ${{ steps.set-secrets-environment.outputs.secrets-environment }} - version-build: ${{ steps.parse-semver.outputs.version-build }} - version-major: ${{ steps.parse-semver.outputs.version-major }} + version-major: ${{ env.VERSION_MAJOR }} version-minor: ${{ steps.parse-semver.outputs.version-minor }} version-patch: ${{ steps.parse-semver.outputs.version-patch }} claw-url: ${{ steps.set-claw-url.outputs.claw-url }} steps: - - name: Set environment - id: set-secrets-environment - run: echo "secrets-environment=PROD" >> "${GITHUB_OUTPUT}" - - name: Set CLAW URL id: set-claw-url run: echo "claw-url=https://packages.cloudfoundry.org" >> "${GITHUB_OUTPUT}" @@ -45,18 +35,21 @@ jobs: - name: Parse semver id: parse-semver run: | - VERSION=$(cat BUILD_VERSION) - VERSION="${VERSION#[vV]}" + git fetch --tags --quiet + latest_tag="$(git tag | sort -V | grep v${VERSION_MAJOR} | tail -1)" + echo "Latest tag is ${latest_tag}" + + version="${latest_tag#[vV]}" - VERSION_MINOR="${VERSION#*.}" - VERSION_MINOR="${VERSION_MINOR%.*}" + version_minor="${version#*.}" + version_minor="${version_minor%.*}" - echo "version-build=${VERSION}" >> "${GITHUB_OUTPUT}" - echo "version-major=${VERSION%%\.*}" >> "${GITHUB_OUTPUT}" - echo "version-minor=${VERSION_MINOR}" >> "${GITHUB_OUTPUT}" - echo "version-patch=${VERSION##*.}" >> "${GITHUB_OUTPUT}" + echo "version-build=${version}" >> "${GITHUB_OUTPUT}" + echo "version-major=${version%%\.*}" >> "${GITHUB_OUTPUT}" + echo "version-minor=${version_minor}" >> "${GITHUB_OUTPUT}" + echo "version-patch=${version##*.}" >> "${GITHUB_OUTPUT}" - echo "VERSION_BUILD=${VERSION}" >> "${GITHUB_ENV}" + echo "VERSION_BUILD=${version}" >> "${GITHUB_ENV}" - name: Test if CLAW serve this version env: @@ -71,7 +64,6 @@ jobs: name: Update Homebrew Repository runs-on: ubuntu-latest needs: setup - environment: ${{ needs.setup.outputs.secrets-environment }} env: CLAW_URL: ${{ needs.setup.outputs.claw-url }} VERSION_BUILD: ${{ needs.setup.outputs.version-build }} @@ -216,7 +208,6 @@ jobs: needs: - setup - update-homebrew - environment: ${{ needs.setup.outputs.secrets-environment }} env: CLAW_URL: ${{ needs.setup.outputs.claw-url }} VERSION_BUILD: ${{ needs.setup.outputs.version-build }} @@ -244,7 +235,6 @@ jobs: name: Update Debian Repository runs-on: ubuntu-20.04 needs: setup - environment: ${{ needs.setup.outputs.secrets-environment }} env: CLAW_URL: ${{ needs.setup.outputs.claw-url }} VERSION_BUILD: ${{ needs.setup.outputs.version-build }} @@ -254,7 +244,6 @@ jobs: - name: Setup run: | echo "VERSION_BUILD: ${VERSION_BUILD}" - echo "Environment: ${ENVIRONMENT}" - name: Checkout uses: actions/checkout@v4 @@ -320,7 +309,6 @@ jobs: needs: - setup - update-deb - environment: ${{ needs.setup.outputs.secrets-environment }} env: CLAW_URL: ${{ needs.setup.outputs.claw-url }} VERSION_BUILD: ${{ needs.setup.outputs.version-build }} @@ -352,7 +340,6 @@ jobs: update-rpm: name: Update RPM Repository runs-on: ubuntu-latest - environment: ${{ needs.setup.outputs.secrets-environment }} needs: setup env: CLAW_URL: ${{ needs.setup.outputs.claw-url }} @@ -361,12 +348,8 @@ jobs: steps: - name: Setup - env: - ENVIRONMENT: ${{ github.event.inputs.environment }} - VERSION_BUILD: ${{ github.event.inputs.build_version }} run: | echo "VERSION_BUILD: ${VERSION_BUILD}" - echo "Environment: ${ENVIRONMENT}" # TODO: fix backup # - name: Download current RPM repodata @@ -450,7 +433,6 @@ jobs: runs-on: ubuntu-latest container: image: fedora - environment: ${{ needs.setup.outputs.secrets-environment }} env: CLAW_URL: ${{ needs.setup.outputs.claw-url }} VERSION_BUILD: ${{ needs.setup.outputs.version-build }} @@ -480,7 +462,6 @@ jobs: run: shell: pwsh needs: setup - environment: ${{ needs.setup.outputs.secrets-environment }} env: CLAW_URL: ${{ needs.setup.outputs.claw-url }} VERSION_BUILD: ${{ needs.setup.outputs.version-build }} @@ -490,7 +471,6 @@ jobs: - name: Setup run: | echo "VERSION_BUILD: ${VERSION_BUILD}" - echo "Environment: ${ENVIRONMENT}" - name: Checkout uses: actions/checkout@v4 @@ -549,7 +529,6 @@ jobs: needs: - setup - update-windows - environment: ${{ needs.setup.outputs.secrets-environment }} env: VERSION_BUILD: ${{ needs.setup.outputs.version-build }} VERSION_MAJOR: ${{ needs.setup.outputs.version-major }} diff --git a/.github/workflows/tests-integration-reusable.yml b/.github/workflows/tests-integration-reusable.yml index cf91d0beadc..cef1bd89a46 100644 --- a/.github/workflows/tests-integration-reusable.yml +++ b/.github/workflows/tests-integration-reusable.yml @@ -3,7 +3,7 @@ # secrets.CLIENT_SECRET # secrets.GITHUB_TOKEN # secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN -# vars.SHEPHERD_POOL_NAME +# vars.TEST_FLAKE_ATTEMPTS name: "pvt: run integration tests" @@ -22,17 +22,29 @@ on: lease-id: required: true type: string + lease-namespace: + required: false + type: string + default: 'tas-devex' gitRef: type: string default: ${{github.event.workflow_run.head_sha}} - + nodes: + type: string + default: "16" + +env: + NODES: ${{ inputs.nodes }} + FLAKE_ATTEMPTS: ${{ vars.TEST_FLAKE_ATTEMPTS || '4' }} + jobs: run-integration-tests: defaults: run: shell: bash - runs-on: ${{ inputs.os }} + runs-on: ${{ inputs.os }} container: us-west2-docker.pkg.dev/shepherd-268822/shepherd2/concourse-resource:latest + timeout-minutes: 120 steps: - name: Checkout cli uses: actions/checkout@v4 @@ -61,7 +73,9 @@ jobs: - name: Install Tools env: - account_token: ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }} + account_token: ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }} + lease_namespace: ${{ inputs.lease-namespace }} + lease_id: ${{ inputs.lease-id }} run: | go version @@ -95,23 +109,23 @@ jobs: apt-get install -y build-essential unzip shepherd login service-account ${account_token} - shepherd get lease ${{ inputs.lease-id }} --namespace tas-devex --json | jq .output > metadata.json + shepherd get lease ${lease_id} --namespace ${lease_namespace} --json | jq .output > metadata.json - name: Add CATS config if: ${{ inputs.name == 'cats' }} run: | set -eu - ENV=$(jq -r .name metadata.json) + env_name=$(jq -r .name metadata.json) API="$(jq -r .cf.api_url metadata.json)" DOMAIN=$(echo $API | sed "s/^api\.//") CF_INT_USERNAME="admin" - jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${ENV}.priv + jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${env_name}.priv eval "$(bbl print-env --metadata-file ./metadata.json)" credhub login - CF_INT_PASSWORD=$(credhub get -n /bosh-$ENV/cf/cf_admin_password | bosh interpolate --path /value -) + CF_INT_PASSWORD=$(credhub get -n /bosh-lite/cf/cf_admin_password | bosh interpolate --path /value -) cat << EOF | jq -S . > cats_config.json { @@ -185,26 +199,24 @@ jobs: --keep-going \ --randomize-all \ --skip-package=helpers \ - --nodes="12" \ - --flake-attempts=2 \ + --nodes="${NODES}" \ + --flake-attempts=${FLAKE_ATTEMPTS} \ --timeout="2h" \ --no-color - name: Run Integration Tests if: ${{ !inputs.run-with-client-creds && inputs.name != 'cats' }} run: | - ENV=$(cat metadata.json | jq -r '.name') - jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${ENV}.priv + env_name=$(cat metadata.json | jq -r '.name') + jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${env_name}.priv eval "$(bbl print-env --metadata-file ./metadata.json)" - export CF_INT_PASSWORD="$(credhub get -n /bosh-$ENV/cf/cf_admin_password | bosh interpolate --path /value -)" + export CF_INT_PASSWORD="$(credhub get -n /bosh-lite/cf/cf_admin_password | bosh interpolate --path /value -)" export CF_INT_OIDC_USERNAME="admin-oidc" - export CF_INT_OIDC_PASSWORD=$(credhub get -n /bosh-$ENV/cf/uaa_oidc_admin_password | bosh interpolate --path /value -) + export CF_INT_OIDC_PASSWORD=$(credhub get -n /bosh-lite/cf/uaa_oidc_admin_password | bosh interpolate --path /value -) API_URL="$(jq -r .cf.api_url metadata.json)" export CF_INT_API="https://$API_URL" export CF_DIAL_TIMEOUT=15 export CF_USERNAME=admin - export FLAKE_ATTEMPTS=2 - export NODES=16 export GOPATH=$PWD/go export PATH="$GOPATH/bin:$PATH" export PATH="$PWD/out:$PATH" @@ -224,18 +236,16 @@ jobs: CF_INT_CLIENT_ID: 'potato-face' CF_INT_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} run: | - ENV=$(cat metadata.json | jq -r '.name') - jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${ENV}.priv + env_name=$(cat metadata.json | jq -r '.name') + jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${env_name}.priv eval "$(bbl print-env --metadata-file ./metadata.json)" - export CF_INT_PASSWORD="$(credhub get -n /bosh-$ENV/cf/cf_admin_password | bosh interpolate --path /value -)" + export CF_INT_PASSWORD="$(credhub get -n /bosh-lite/cf/cf_admin_password | bosh interpolate --path /value -)" export CF_INT_OIDC_USERNAME="admin-oidc" - export CF_INT_OIDC_PASSWORD=$(credhub get -n /bosh-$ENV/cf/uaa_oidc_admin_password | bosh interpolate --path /value -) + export CF_INT_OIDC_PASSWORD=$(credhub get -n /bosh-lite/cf/uaa_oidc_admin_password | bosh interpolate --path /value -) API_URL="$(jq -r .cf.api_url metadata.json)" export CF_INT_API="https://$API_URL" export CF_DIAL_TIMEOUT=15 export CF_USERNAME=admin - export FLAKE_ATTEMPTS=2 - export NODES=16 export GOPATH=$PWD/go export PATH="$GOPATH/bin:$PATH" export PATH="$PWD/out:$PATH" @@ -247,4 +257,4 @@ jobs: cf api ${CF_INT_API} --skip-ssl-validation cf auth - make integration-tests-full-ci \ No newline at end of file + make integration-tests-ci-client-creds diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index f88e9d9072b..3ce00b130f6 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -1,3 +1,14 @@ +# GitHub repo level Secrets and Variables + +# secrets.CLIENT_SECRET +# secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN +# vars.CAPI_RELEASE_VERSION +# vars.SHEPHERD_LEASE_DURATION +# vars.SHEPHERD_LEASE_NAMESPACE +# vars.SHEPHERD_TEMPLATE_ARGUMENT +# vars.SHEPHERD_TEMPLATE_NAME +# vars.SHEPHERD_TEMPLATE_NAMESPACE + name: "Tests: Integration" run-name: "Integration [${{ github.event_name }}: ${{ github.event.pull_request.head.sha || github.event.push.after || github.event.workflow_run.head_sha}}]: ${{ github.event.workflow_run.head_commit.message }}" @@ -14,6 +25,34 @@ on: - run-integration-tests-cf-env - run-integration-tests-cf-env-with-client-creds - run-cats-cf-env + nodes: + description: Number of test nodes + required: false + type: string + default: "12" + lease_id: + description: Pre-provisioned environment lease-id to use in tests + required: false + type: string + lease_namespace: + description: Pre-provisioned environment lease namespace to use in tests + required: false + type: string + cfd_version: + description: Use specific version of CFD. Leave empty to use latest. + default: "" + type: string + run_unit_tests: + description: Run unit tests + required: false + type: boolean + default: true + reinstall_cfd: + description: Force re-installation of CFD + required: false + type: boolean + default: true + push: tags: - "v8.*" @@ -31,7 +70,12 @@ on: - ".grype.yaml" - ".git*" - ".golangci.json" + +env: + SHEPHERD_LEASE_ID: ${{ inputs.lease_id }} + jobs: + get-sha: runs-on: ubuntu-latest outputs: @@ -57,14 +101,17 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + if: ${{ inputs.run_unit_tests == 'true' }} with: ref: ${{needs.get-sha.outputs.gitRef}} - name: Set Up Go uses: actions/setup-go@v5 + if: ${{ inputs.run_unit_tests == 'true' }} with: go-version-file: go.mod check-latest: true - name: Run Units + if: ${{ inputs.run_unit_tests == 'true' }} run: make units claim-env: @@ -88,23 +135,63 @@ jobs: - name: claim id: claim env: - account_token: ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }} - pool_name: ${{ vars.SHEPHERD_POOL_NAME }} - pool_namespace: official + account_token: ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }} + template_argument: ${{ vars.SHEPHERD_TEMPLATE_ARGUMENT }} + template_name: ${{ vars.SHEPHERD_TEMPLATE_NAME || 'cfd-bosh-lite@1.0' }} + template_namespace: ${{ vars.SHEPHERD_TEMPLATE_NAMESPACE || 'official' }} + lease_duration: ${{ vars.SHEPHERD_LEASE_DURATION || '8h' }} + lease_namespace: ${{ inputs.lease_namespace || vars.SHEPHERD_LEASE_NAMESPACE || 'tas-devex' }} + cfd_version: ${{ inputs.cfd_version || vars.CFD_VERSION || '' }} run: | shepherd login service-account ${account_token} - echo "shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace ${pool_namespace} --namespace tas-devex --description 'CLI GHA'" - lease_id=$(shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace ${pool_namespace} --namespace tas-devex --json | jq -r .id) - + if [[ -z $SHEPHERD_LEASE_ID ]]; then + + if [ -z "$template_argument" ]; then + export template_argument=$(cat < metadata.json + shepherd get lease ${lease_id} \ + --namespace ${lease_namespace} \ + --json \ + | jq .output > metadata.json break elif [ $status == "FAILED" -o $status == "EXPIRED" ] ; then echo "There was an error obtaining the lease. Lease status is ${status}." @@ -119,7 +206,7 @@ jobs: echo "env name is ${env_name}" echo "leaseid=${lease_id}" >> "${GITHUB_OUTPUT}" - cf_deployment_version=$(jq -r '."cf-deployment_version"' metadata.json) + cf_deployment_version=$(jq -r '."cf_deployment_version"' metadata.json) echo "cf_deployment_version is ${cf_deployment_version}" echo "cf_deployment_version=${cf_deployment_version}" >> "${GITHUB_OUTPUT}" @@ -130,6 +217,7 @@ jobs: check-latest: true - name: Install Tools + if: ${{ (inputs.lease_id == '') || (inputs.reinstall_cfd == true) }} run: | go version @@ -149,11 +237,11 @@ jobs: apt-get install -y build-essential unzip - name: Upload latest CAPI release + if: ${{ (inputs.lease_id == '') || (inputs.reinstall_cfd == true) }} env: capi_release_version: ${{ vars.CAPI_RELEASE_VERSION }} run: | - if [ -z "$capi_release_version" ] - then + if [ -z "$capi_release_version" ]; then capi_release_version=$(curl -s https://api.github.com/repos/cloudfoundry/capi-release/releases/latest | jq -r .tag_name) fi @@ -166,6 +254,7 @@ jobs: bosh upload-release "https://bosh.io/d/github.com/cloudfoundry/capi-release?v=$capi_release_version" - name: Checkout cf-deployment + if: ${{ (inputs.lease_id == '') || (inputs.reinstall_cfd == true) }} uses: actions/checkout@v4 with: repository: cloudfoundry/cf-deployment @@ -173,12 +262,12 @@ jobs: ref: ${{steps.claim.outputs.cf_deployment_version}} - name: Deploy Isolation Segment and OIDC Provider + if: ${{ (inputs.lease_id == '') || (inputs.reinstall_cfd == true) }} run: | 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)" - # deploy bosh -d cf manifest > /tmp/manifest.yml bosh interpolate /tmp/manifest.yml \ -o cf-deployment/operations/use-internal-lookup-for-route-services.yml \ @@ -208,6 +297,8 @@ jobs: name: Integration gitRef: ${{needs.get-sha.outputs.gitRef}} lease-id: ${{ needs.claim-env.outputs.leaseid }} + lease-namespace: ${{ inputs.lease_namespace || vars.SHEPHERD_LEASE_NAMESPACE || 'tas-devex' }} + nodes: ${{ inputs.nodes }} secrets: inherit run-integration-tests-cf-env-with-client-creds: @@ -224,6 +315,7 @@ jobs: name: Integration client creds gitRef: ${{needs.get-sha.outputs.gitRef}} lease-id: ${{ needs.claim-env.outputs.leaseid }} + lease-namespace: ${{ inputs.lease_namespace || vars.SHEPHERD_LEASE_NAMESPACE || 'tas-devex' }} secrets: inherit run-cats-cf-env: @@ -241,21 +333,24 @@ jobs: name: cats gitRef: ${{needs.get-sha.outputs.gitRef}} lease-id: ${{ needs.claim-env.outputs.leaseid }} + lease-namespace: ${{ inputs.lease_namespace || vars.SHEPHERD_LEASE_NAMESPACE || 'tas-devex' }} secrets: inherit unclaim-env: name: Unclaim environment + if: ${{ inputs.lease_id == '' }} runs-on: ubuntu-latest container: us-west2-docker.pkg.dev/shepherd-268822/shepherd2/concourse-resource:latest needs: - claim-env - run-cats-cf-env - if: always() steps: - name: unclaim env: - account_token: ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }} + account_token: ${{ secrets.SHEPHERD_SERVICE_ACCOUNT_TOKEN }} + lease_namespace: ${{ inputs.lease_namespace || vars.SHEPHERD_LEASE_NAMESPACE || 'tas-devex' }} run: | shepherd login service-account ${account_token} set -x - shepherd delete lease ${{ needs.claim-env.outputs.leaseid }} --namespace tas-devex + shepherd delete lease ${{ needs.claim-env.outputs.leaseid }} \ + --namespace ${lease_namespace} diff --git a/.gitignore b/.gitignore index bdd84341efc..cc14c3edb44 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,5 @@ integration/assets/test_plugin/test_plugin ### VisualStudioCode ### .vscode +.secrets +.vars diff --git a/BUILD_VERSION b/BUILD_VERSION deleted file mode 100644 index bf4e26f4a85..00000000000 --- a/BUILD_VERSION +++ /dev/null @@ -1 +0,0 @@ -9.0.0-beta diff --git a/Makefile b/Makefile index b6f31d305e6..012e5716e0d 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ CF_DIAL_TIMEOUT ?= 15 NODES ?= 10 +FLAKE_ATTEMPTS ?=5 PACKAGES ?= api actor command types util version integration/helpers LC_ALL = "en_US.UTF-8" -CF_BUILD_VERSION ?= $$(cat BUILD_VERSION) # TODO: version specific CF_BUILD_SHA ?= $$(git rev-parse --short HEAD) CF_BUILD_DATE ?= $$(date -u +"%Y-%m-%d") LD_FLAGS_COMMON=-w -s \ @@ -131,6 +131,7 @@ integration-selfcontained: build install-test-deps integration-tests: build integration-cleanup integration-isolated integration-push integration-global integration-selfcontained ## Run all isolated, push, selfcontained, and global integration tests +integration-tests-ci-client-creds: build integration-cleanup integration-push integration-global integration-selfcontained i: integration-tests-full integration-full-tests: integration-tests-full diff --git a/bin/bump-version b/bin/bump-version deleted file mode 100755 index b4693dc4e90..00000000000 --- a/bin/bump-version +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -set -eo pipefail - -component=$1 -script_dir=$(dirname $0) -version_file="$script_dir/../BUILD_VERSION" - -old_version=$(cat $version_file) -major=$(echo $old_version | cut -d'.' -f 1) -minor=$(echo $old_version | cut -d'.' -f 2) -patchAndSuffix=$(echo $old_version | cut -d'.' -f 3) -patch=$(echo $patchAndSuffix | cut -d'-' -f 1) -suffix=$(echo $patchAndSuffix | cut -s -d'-' -f 2) - -case "$component" in - major ) - major=$(expr $major + 1) - minor=0 - patch=0 - ;; - minor ) - minor=$(expr $minor + 1) - patch=0 - ;; - patch ) - patch=$(expr $patch + 1) - ;; - * ) - echo "Error - argument must be 'major', 'minor' or 'patch'" - echo "Usage: bump-version [major | minor | patch]" - exit 1 - ;; -esac -set -u - -version=$major.$minor.$patch - -if [ ! -z "$suffix" ]; then - version="${version}-${suffix}" -fi - -echo "Updating BUILD_VERSION file to $version" -echo $version > $version_file - -echo "Committing change" -git reset . -git add $version_file - -git commit -m "Bump version to $version" diff --git a/bin/generate-release-notes b/bin/generate-release-notes deleted file mode 100755 index 0a06524f399..00000000000 --- a/bin/generate-release-notes +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -VERSION=$(cat BUILD_VERSION) - -cat <<-NOTES -Package Manager Installation ----------- -- [apt-get, yum, homebrew](https://github.com/cloudfoundry/cli#getting-started) - -Installers ----------- -- Debian [64 bit](https://packages.cloudfoundry.org/stable?release=debian64&version=$VERSION&source=github-rel) / [32 bit](https://packages.cloudfoundry.org/stable?release=debian32&version=$VERSION&source=github-rel) / [arm64](https://packages.cloudfoundry.org/stable?release=debianarm64&version=$VERSION&source=github-rel) (deb) -- Redhat [64 bit](https://packages.cloudfoundry.org/stable?release=redhat64&version=$VERSION&source=github-rel) / [32 bit](https://packages.cloudfoundry.org/stable?release=redhat32&version=$VERSION&source=github-rel) / [aarch64](https://packages.cloudfoundry.org/stable?release=redhataarch64&version=$VERSION&source=github-rel) (rpm) -- macOS [64 bit](https://packages.cloudfoundry.org/stable?release=macosx64&version=$VERSION&source=github-rel) / [arm](https://packages.cloudfoundry.org/stable?release=macosarm&version=$VERSION&source=github-rel) (pkg) -- Windows [64 bit](https://packages.cloudfoundry.org/stable?release=windows64&version=$VERSION&source=github-rel) / [32 bit](https://packages.cloudfoundry.org/stable?release=windows32&version=$VERSION&source=github-rel) (zip) - -Binaries --------- -- Linux [64 bit](https://packages.cloudfoundry.org/stable?release=linux64-binary&version=$VERSION&source=github-rel) / [32 bit](https://packages.cloudfoundry.org/stable?release=linux32-binary&version=$VERSION&source=github-rel) / [arm64](https://packages.cloudfoundry.org/stable?release=linuxarm64-binary&version=$VERSION&source=github-rel) (tgz) -- macOS [64 bit](https://packages.cloudfoundry.org/stable?release=macosx64-binary&version=$VERSION&source=github-rel) / [arm](https://packages.cloudfoundry.org/stable?release=macosarm-binary&version=$VERSION&source=github-rel) (tgz) -- Windows [64 bit](https://packages.cloudfoundry.org/stable?release=windows64-exe&version=$VERSION&source=github-rel) / [32 bit](https://packages.cloudfoundry.org/stable?release=windows32-exe&version=$VERSION&source=github-rel) (zip) - - -Docker --------- -\`\`\`shell -docker pull cloudfoundry/cli:$VERSION -\`\`\` - -Change Log ----------- -NOTES diff --git a/build_data.yml b/build_data.yml deleted file mode 100644 index 06100fe6449..00000000000 --- a/build_data.yml +++ /dev/null @@ -1,3 +0,0 @@ -build-version: 9.0.0-beta -capi-version-min: v16.11.0 -capi-version-max: v99.99.99 diff --git a/integration/helpers/org_and_space.go b/integration/helpers/org_and_space.go index e098a3bcd16..c08150762eb 100644 --- a/integration/helpers/org_and_space.go +++ b/integration/helpers/org_and_space.go @@ -112,7 +112,7 @@ func GetSpaceGUID(spaceName string) string { } // QuickDeleteOrg deletes the org with the given name, if provided, using -// 'cf curl /v2/organizations... -X DELETE'. +// 'cf curl /v3/organizations... -X DELETE'. func QuickDeleteOrg(orgName string) { // If orgName is empty, the BeforeSuite has failed and attempting to delete // will produce a meaningless error. @@ -122,13 +122,13 @@ func QuickDeleteOrg(orgName string) { } guid := GetOrgGUID(orgName) - url := fmt.Sprintf("/v2/organizations/%s?recursive=true&async=true", guid) + url := fmt.Sprintf("/v3/organizations/%s", guid) session := CF("curl", "-X", "DELETE", url) Eventually(session).Should(Exit(0)) } // QuickDeleteOrgIfExists deletes the org with the given name, if it exists, using -// 'cf curl /v2/organizations... -X DELETE'. +// 'cf curl /v3/organizations... -X DELETE'. func QuickDeleteOrgIfExists(orgName string) { session := CF("org", "--guid", orgName) Eventually(session).Should(Exit()) @@ -136,16 +136,16 @@ func QuickDeleteOrgIfExists(orgName string) { return } guid := strings.TrimSpace(string(session.Out.Contents())) - url := fmt.Sprintf("/v2/organizations/%s?recursive=true&async=true", guid) + url := fmt.Sprintf("/v3/organizations/%s", guid) session = CF("curl", "-X", "DELETE", url) Eventually(session).Should(Exit()) } // QuickDeleteSpace deletes the space with the given name, if it exists, using -// 'cf curl /v2/spaces... -X DELETE'. +// 'cf curl /v3/spaces... -X DELETE'. func QuickDeleteSpace(spaceName string) { guid := GetSpaceGUID(spaceName) - url := fmt.Sprintf("/v2/spaces/%s?recursive=true&async=true", guid) + url := fmt.Sprintf("/v3/spaces/%s", guid) session := CF("curl", "-X", "DELETE", url) Eventually(session).Should(Exit(0)) } diff --git a/integration/shared/isolated/spaces_command_test.go b/integration/shared/isolated/spaces_command_test.go index 823a22197cf..1aa98ef5757 100644 --- a/integration/shared/isolated/spaces_command_test.go +++ b/integration/shared/isolated/spaces_command_test.go @@ -30,6 +30,10 @@ var _ = Describe("spaces command", func() { helpers.TargetOrg(orgName) }) + AfterEach(func() { + helpers.QuickDeleteOrg(orgName) + }) + When("there are no spaces", func() { It("displays no spaces found", func() { session := helpers.CF("spaces") diff --git a/integration/shared/plugin/api_test.go b/integration/shared/plugin/api_test.go index 2a6d9751d46..49767de8fd2 100644 --- a/integration/shared/plugin/api_test.go +++ b/integration/shared/plugin/api_test.go @@ -13,11 +13,16 @@ import ( ) var _ = Describe("plugin API", func() { + var orgName string BeforeEach(func() { + orgName = "" installTestPlugin() }) AfterEach(func() { + if orgName != "" { + helpers.QuickDeleteOrg(orgName) + } uninstallTestPlugin() }) @@ -63,7 +68,7 @@ var _ = Describe("plugin API", func() { Describe("GetApp", func() { var appName string BeforeEach(func() { - createTargetedOrgAndSpace() + orgName, _ = createTargetedOrgAndSpace() appName = helpers.PrefixedRandomName("APP") helpers.WithHelloWorldApp(func(appDir string) { Eventually(helpers.CF("push", appName, "--no-start", "-p", appDir, "-b", "staticfile_buildpack", "--no-route")).Should(Exit(0)) @@ -78,7 +83,7 @@ var _ = Describe("plugin API", func() { Describe("GetApps", func() { var appName1, appName2 string BeforeEach(func() { - createTargetedOrgAndSpace() + orgName, _ = createTargetedOrgAndSpace() appName1 = helpers.PrefixedRandomName("APP") helpers.WithHelloWorldApp(func(appDir string) { Eventually(helpers.CF("push", appName1, "--no-start", "-p", appDir, "-b", "staticfile_buildpack", "--no-route")).Should(Exit(0)) @@ -97,29 +102,35 @@ var _ = Describe("plugin API", func() { Describe("GetCurrentOrg", func() { It("gets the current targeted org", func() { - org, _ := createTargetedOrgAndSpace() - confirmTestPluginOutput("GetCurrentOrg", org) + orgName, _ = createTargetedOrgAndSpace() + confirmTestPluginOutput("GetCurrentOrg", orgName) }) }) Describe("GetCurrentSpace", func() { It("gets the current targeted Space", func() { - _, space := createTargetedOrgAndSpace() + var space string + orgName, space = createTargetedOrgAndSpace() confirmTestPluginOutput("GetCurrentSpace", space) }) }) Describe("GetOrg", func() { It("gets the given org", func() { - org, _ := createTargetedOrgAndSpace() - confirmTestPluginOutputWithArg("GetOrg", org, org) + orgName, _ = createTargetedOrgAndSpace() + confirmTestPluginOutputWithArg("GetOrg", orgName, orgName) }) }) Describe("GetOrgs", func() { + var org1, org2 string + AfterEach(func() { + helpers.QuickDeleteOrg(org1) + helpers.QuickDeleteOrg(org2) + }) It("gets information for multiple orgs", func() { - org1, _ := createTargetedOrgAndSpace() - org2, _ := createTargetedOrgAndSpace() + org1, _ = createTargetedOrgAndSpace() + org2, _ = createTargetedOrgAndSpace() orgNameRegexp := fmt.Sprintf("(?:%s|%s)", org1, org2) confirmTestPluginOutput("GetOrgs", orgNameRegexp, orgNameRegexp) }) @@ -127,17 +138,17 @@ var _ = Describe("plugin API", func() { Describe("GetOrgUsers", func() { It("returns the org users", func() { - org, _ := createTargetedOrgAndSpace() + orgName, _ = createTargetedOrgAndSpace() username, _ := helpers.GetCredentials() - confirmTestPluginOutputWithArg("GetOrgUsers", org, username) + confirmTestPluginOutputWithArg("GetOrgUsers", orgName, username) }) }) Describe("GetOrgUsers", func() { It("returns the org users", func() { - org, _ := createTargetedOrgAndSpace() + orgName, _ = createTargetedOrgAndSpace() username, _ := helpers.GetCredentials() - confirmTestPluginOutputWithArg("GetOrgUsers", org, username) + confirmTestPluginOutputWithArg("GetOrgUsers", orgName, username) }) }) @@ -148,7 +159,7 @@ var _ = Describe("plugin API", func() { broker *servicebrokerstub.ServiceBrokerStub ) BeforeEach(func() { - createTargetedOrgAndSpace() + orgName, _ = createTargetedOrgAndSpace() serviceInstance1 = helpers.PrefixedRandomName("SI1") serviceInstance2 = helpers.PrefixedRandomName("SI2") @@ -172,7 +183,8 @@ var _ = Describe("plugin API", func() { Describe("GetSpace", func() { It("gets the given space", func() { - _, space := createTargetedOrgAndSpace() + var space string + orgName, space = createTargetedOrgAndSpace() confirmTestPluginOutputWithArg("GetSpace", space, space) }) }) @@ -181,7 +193,7 @@ var _ = Describe("plugin API", func() { var space1, space2 string BeforeEach(func() { - _, space1 = createTargetedOrgAndSpace() + orgName, space1 = createTargetedOrgAndSpace() space2 = helpers.NewSpaceName() helpers.CreateSpace(space2) }) @@ -195,8 +207,9 @@ var _ = Describe("plugin API", func() { Describe("GetSpaceUsers", func() { It("returns the space users", func() { username, _ := helpers.GetCredentials() - org, space := createTargetedOrgAndSpace() - session := helpers.CF("GetSpaceUsers", org, space) + var space string + orgName, space = createTargetedOrgAndSpace() + session := helpers.CF("GetSpaceUsers", orgName, space) Eventually(session).Should(Say(username)) Eventually(session).Should(Exit(0)) }) @@ -210,14 +223,14 @@ var _ = Describe("plugin API", func() { Describe("HasOrganization", func() { It("returns true", func() { - createTargetedOrgAndSpace() + orgName, _ = createTargetedOrgAndSpace() confirmTestPluginOutput("HasOrganization", "true") }) }) Describe("HasSpace", func() { It("returns true", func() { - createTargetedOrgAndSpace() + orgName, _ = createTargetedOrgAndSpace() confirmTestPluginOutput("HasSpace", "true") }) }) diff --git a/integration/v7/global/running_security_groups_command_test.go b/integration/v7/global/running_security_groups_command_test.go index 0a8a8d2c001..c51332ffc5d 100644 --- a/integration/v7/global/running_security_groups_command_test.go +++ b/integration/v7/global/running_security_groups_command_test.go @@ -70,6 +70,7 @@ var _ = Describe("running-security-groups command", func() { AfterEach(func() { helpers.DeleteSecurityGroup(securityGroup) + helpers.QuickDeleteOrg(orgName) }) It("displays the globally enabled running security groups exits 0", func() { diff --git a/integration/v7/global/set_space_role_command_test.go b/integration/v7/global/set_space_role_command_test.go index 428aef465aa..e04bb7a992e 100644 --- a/integration/v7/global/set_space_role_command_test.go +++ b/integration/v7/global/set_space_role_command_test.go @@ -26,6 +26,7 @@ var _ = Describe("set-space-role command", func() { AfterEach(func() { helpers.EnableFeatureFlag("set_roles_by_username") + helpers.QuickDeleteOrg(orgName) }) When("the user does not exist", func() { diff --git a/integration/v7/global/staging_security_groups_command_test.go b/integration/v7/global/staging_security_groups_command_test.go index cddabcfbfeb..9bfae4e201c 100644 --- a/integration/v7/global/staging_security_groups_command_test.go +++ b/integration/v7/global/staging_security_groups_command_test.go @@ -70,6 +70,7 @@ var _ = Describe("staging-security-groups command", func() { AfterEach(func() { helpers.DeleteSecurityGroup(securityGroup) + helpers.QuickDeleteOrg(orgName) }) It("displays the globally enabled staging security groups exits 0", func() { diff --git a/integration/v7/isolated/create_space_quota_command_test.go b/integration/v7/isolated/create_space_quota_command_test.go index e81832ba691..65ba81b7162 100644 --- a/integration/v7/isolated/create_space_quota_command_test.go +++ b/integration/v7/isolated/create_space_quota_command_test.go @@ -60,6 +60,10 @@ var _ = Describe("create-space-quota command", func() { spaceQuotaName = helpers.QuotaName() }) + AfterEach(func() { + helpers.QuickDeleteOrg(orgName) + }) + When("the quota name is not provided", func() { It("tells the user that the quota name is required, prints help text, and exits 1", func() { session := helpers.CF("create-space-quota") diff --git a/integration/v7/isolated/move_route_command_test.go b/integration/v7/isolated/move_route_command_test.go index bf83e969252..a2944170639 100644 --- a/integration/v7/isolated/move_route_command_test.go +++ b/integration/v7/isolated/move_route_command_test.go @@ -147,6 +147,8 @@ var _ = Describe("move route command", func() { AfterEach(func() { domain.DeleteShared() + helpers.QuickDeleteOrg(targetOrgName) + helpers.QuickDeleteOrg(orgName) }) It("Transfers ownership of the route to the destination space", func() { diff --git a/integration/v7/isolated/org_users_command_test.go b/integration/v7/isolated/org_users_command_test.go index 7df37dcb8a8..7468449c7bb 100644 --- a/integration/v7/isolated/org_users_command_test.go +++ b/integration/v7/isolated/org_users_command_test.go @@ -40,6 +40,10 @@ var _ = Describe("org-users command", func() { helpers.CreateOrg(orgName) }) + AfterEach(func() { + helpers.QuickDeleteOrg(orgName) + }) + When("the target org has multiple users with different roles", func() { var ( orgManagerUser string diff --git a/integration/v7/isolated/rename_org_command_test.go b/integration/v7/isolated/rename_org_command_test.go index e440ca34575..ed1f457c0a9 100644 --- a/integration/v7/isolated/rename_org_command_test.go +++ b/integration/v7/isolated/rename_org_command_test.go @@ -107,6 +107,10 @@ var _ = Describe("rename-org command", func() { helpers.CreateOrg(orgNameNew) }) + AfterEach(func() { + helpers.QuickDeleteOrg(orgNameNew) + }) + It("fails to rename the org", func() { session := helpers.CF("rename-org", orgName, orgNameNew) userName, _ := helpers.GetCredentials() diff --git a/integration/v7/isolated/scale_command_test.go b/integration/v7/isolated/scale_command_test.go index 8715deac587..1bdd2b11d23 100644 --- a/integration/v7/isolated/scale_command_test.go +++ b/integration/v7/isolated/scale_command_test.go @@ -105,10 +105,10 @@ var _ = Describe("scale command", func() { helpers.WithProcfileApp(func(appDir string) { Eventually(helpers.CustomCF(helpers.CFEnv{WorkingDirectory: appDir}, "push", appName)).Should(Exit(0)) }) - helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false, "1G") + helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false, "256M") }) - When("scale option flags are not provided", func() { + XWhen("scale option flags are not provided", func() { It("displays the current scale properties for all processes", func() { session := helpers.CF("scale", appName) @@ -162,7 +162,7 @@ var _ = Describe("scale command", func() { Consistently(session).ShouldNot(Say("Stopping")) Consistently(session).ShouldNot(Say("Starting")) - helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, true, "1G") + helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, true, "256M") session = helpers.CF("app", appName) Eventually(session).Should(Exit(0)) @@ -179,7 +179,17 @@ var _ = Describe("scale command", func() { }) }) - When("Scaling the memory", func() { + When("-f flag provided", func() { + It("scales without prompt", func() { + session := helpers.CF("scale", appName, "-m", "64M", "-f") + Eventually(session).Should(Exit(0)) + Expect(session).To(Say("Scaling app %s in org %s / space %s as %s...", appName, orgName, spaceName, userName)) + + helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false, "64M") + }) + }) + + XWhen("Scaling the memory", func() { It("scales memory to 64M", func() { buffer := NewBuffer() _, err := buffer.Write([]byte("y\n")) @@ -194,7 +204,7 @@ var _ = Describe("scale command", func() { helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false, "64M") }) - When("-f flag provided", func() { + XWhen("-f flag provided", func() { It("scales without prompt", func() { session := helpers.CF("scale", appName, "-m", "64M", "-f") Eventually(session).Should(Exit(0)) @@ -205,7 +215,7 @@ var _ = Describe("scale command", func() { }) }) - When("Scaling the disk space", func() { + XWhen("Scaling the disk space", func() { It("scales disk to 512M", func() { buffer := NewBuffer() _, err := buffer.Write([]byte("y\n")) @@ -221,7 +231,7 @@ var _ = Describe("scale command", func() { helpers.WaitForAppDiskToTakeEffect(appName, 0, 0, false, "512M") }) - When("-f flag provided", func() { + XWhen("-f flag provided", func() { It("scales without prompt", func() { session := helpers.CF("scale", appName, "-k", "512M", "-f") Eventually(session).Should(Exit(0)) @@ -232,7 +242,7 @@ var _ = Describe("scale command", func() { }) }) - When("Scaling the log rate limit", func() { + XWhen("Scaling the log rate limit", func() { BeforeEach(func() { helpers.SkipIfVersionLessThan(ccversion.MinVersionLogRateLimitingV3) }) @@ -252,7 +262,7 @@ var _ = Describe("scale command", func() { helpers.WaitForLogRateLimitToTakeEffect(appName, 0, 0, false, "1M") }) - When("-f flag provided", func() { + XWhen("-f flag provided", func() { It("scales without prompt", func() { session := helpers.CF("scale", appName, "-l", "1M", "-f") Eventually(session).Should(Exit(0)) diff --git a/integration/v7/isolated/security_groups_command_test.go b/integration/v7/isolated/security_groups_command_test.go index bee8a02bc21..828f18ca7e5 100644 --- a/integration/v7/isolated/security_groups_command_test.go +++ b/integration/v7/isolated/security_groups_command_test.go @@ -118,6 +118,7 @@ var _ = Describe("security-groups command", func() { helpers.DeleteSecurityGroup(securityGroup3) helpers.DeleteSecurityGroup(securityGroup4) helpers.DeleteSecurityGroup(securityGroup5) + helpers.QuickDeleteOrg(orgName) }) It("displays the security groups exits 0", func() { diff --git a/integration/v7/isolated/services_command_test.go b/integration/v7/isolated/services_command_test.go index 44af6c2b8f0..fa13324ea09 100644 --- a/integration/v7/isolated/services_command_test.go +++ b/integration/v7/isolated/services_command_test.go @@ -163,11 +163,11 @@ var _ = Describe("services command", func() { Context("has shared service instances", func() { var ( - managedService, appNameOnSpaceA, appNameOnSpaceB string + managedService, appNameOnSpaceA, appNameOnSpaceB, orgName string ) BeforeEach(func() { - orgName := helpers.NewOrgName() + orgName = helpers.NewOrgName() spaceA := helpers.NewSpaceName() spaceB := helpers.NewSpaceName() managedService = helpers.PrefixedRandomName("MANAGED1") @@ -193,6 +193,10 @@ var _ = Describe("services command", func() { helpers.TargetOrgAndSpace(orgName, spaceA) }) + AfterEach(func() { + helpers.QuickDeleteOrg(orgName) + }) + It("should not output bound apps in the shared spaces", func() { session := helpers.CF(command) Eventually(session).Should(Exit(0)) diff --git a/integration/v7/isolated/share_private_domain_test.go b/integration/v7/isolated/share_private_domain_test.go index c660b0c1c1e..4ad4454a0b4 100644 --- a/integration/v7/isolated/share_private_domain_test.go +++ b/integration/v7/isolated/share_private_domain_test.go @@ -58,6 +58,11 @@ var _ = Describe("share-private-domain command", func() { domain.CreatePrivate() }) + AfterEach(func() { + helpers.QuickDeleteOrg(sharedWithOrgName) + helpers.QuickDeleteOrg(orgName) + }) + It("should create the shared domain", func() { session := helpers.CF("share-private-domain", sharedWithOrgName, domainName) diff --git a/integration/v7/isolated/share_route_command_test.go b/integration/v7/isolated/share_route_command_test.go index 51a0191a725..1cfa3ea9dd2 100644 --- a/integration/v7/isolated/share_route_command_test.go +++ b/integration/v7/isolated/share_route_command_test.go @@ -147,6 +147,7 @@ var _ = Describe("share route command", func() { AfterEach(func() { domain.Delete() + helpers.QuickDeleteOrg(targetOrgName) }) It("shared the route to the destination space", func() { diff --git a/integration/v7/isolated/space_quota_command_test.go b/integration/v7/isolated/space_quota_command_test.go index c1336c668e4..3d97c8845cf 100644 --- a/integration/v7/isolated/space_quota_command_test.go +++ b/integration/v7/isolated/space_quota_command_test.go @@ -49,6 +49,10 @@ var _ = Describe("space-quota command", func() { helpers.TargetOrg(orgName) }) + AfterEach(func() { + helpers.QuickDeleteOrg(orgName) + }) + When("the quota does not exist", func() { It("displays quota not found and exits 1", func() { session := helpers.CF("space-quota", quotaName) diff --git a/integration/v7/isolated/space_users_command_test.go b/integration/v7/isolated/space_users_command_test.go index fb1a37ad226..fc55f01a18c 100644 --- a/integration/v7/isolated/space_users_command_test.go +++ b/integration/v7/isolated/space_users_command_test.go @@ -42,6 +42,10 @@ var _ = Describe("space-users command", func() { helpers.CreateOrgAndSpace(orgName, spaceName) }) + AfterEach(func() { + helpers.QuickDeleteOrg(orgName) + }) + When("the target space has multiple users with different roles", func() { var ( spaceManagerUser string diff --git a/integration/v7/isolated/spaces_command_test.go b/integration/v7/isolated/spaces_command_test.go index fdbb27b54a4..6c52d822bc5 100644 --- a/integration/v7/isolated/spaces_command_test.go +++ b/integration/v7/isolated/spaces_command_test.go @@ -60,6 +60,10 @@ var _ = Describe("spaces command", func() { helpers.CreateSpace(spaceName6) }) + AfterEach(func() { + helpers.QuickDeleteOrg(orgName) + }) + When("the --labels flag is given", func() { BeforeEach(func() { diff --git a/integration/v7/isolated/start_command_test.go b/integration/v7/isolated/start_command_test.go index ed42395fde3..5cb14b3f480 100644 --- a/integration/v7/isolated/start_command_test.go +++ b/integration/v7/isolated/start_command_test.go @@ -128,7 +128,7 @@ var _ = Describe("start command", func() { Eventually(session).Should(Say(`routes:\s+%s.%s`, appName, helpers.DefaultSharedDomain())) Eventually(session).Should(Say(`type:\s+web`)) Eventually(session).Should(Say(`instances:\s+1/1`)) - Eventually(session).Should(Say(`memory usage:\s+1024M`)) + Eventually(session).Should(Say(`memory usage:\s+256M`)) Eventually(session).Should(Say(`\s+state\s+since\s+cpu entitlement\s+memory\s+disk\s+logging\s+details`)) Eventually(session).Should(Say(`#0\s+(starting|running)\s+\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z`)) diff --git a/integration/v7/isolated/unshare_private_domain_test.go b/integration/v7/isolated/unshare_private_domain_test.go index 3ff7bc00b46..d04ed265526 100644 --- a/integration/v7/isolated/unshare_private_domain_test.go +++ b/integration/v7/isolated/unshare_private_domain_test.go @@ -70,6 +70,10 @@ var _ = Describe("unshare-private-domain command", func() { domain.V7Share(sharedToOrgName) }) + AfterEach(func() { + helpers.QuickDeleteOrg(sharedToOrgName) + }) + It("unshares the domain from the org", func() { buffer := NewBuffer() _, err := buffer.Write([]byte("y\n")) @@ -98,6 +102,10 @@ var _ = Describe("unshare-private-domain command", func() { domain.V7Share(sharedToOrgName) }) + AfterEach(func() { + helpers.QuickDeleteOrg(sharedToOrgName) + }) + It("does not unshare the domain from the org", func() { buffer := NewBuffer() _, err := buffer.Write([]byte("n\n")) diff --git a/integration/v7/isolated/unshare_route_command_test.go b/integration/v7/isolated/unshare_route_command_test.go index 1fb18511232..581e2f2b875 100644 --- a/integration/v7/isolated/unshare_route_command_test.go +++ b/integration/v7/isolated/unshare_route_command_test.go @@ -152,6 +152,7 @@ var _ = Describe("unshare route command", func() { AfterEach(func() { domain.Delete() + helpers.QuickDeleteOrg(targetOrgName) }) It("unshared the route from the intended space", func() {