diff --git a/.github/workflows/functional-baremetal.yaml b/.github/workflows/functional-baremetal.yaml index fc1bbf2536..333f486a9d 100644 --- a/.github/workflows/functional-baremetal.yaml +++ b/.github/workflows/functional-baremetal.yaml @@ -86,10 +86,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-baremetal env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: '^.*baremetal(.(?!noauth).*)?$' OS_BRANCH: ${{ matrix.openstack_version }} # TODO(dtantsur): default to "all" when no longer supporting versions before 2024.1 OS_SYSTEM_SCOPE: ${{ matrix.os_system_scope }} diff --git a/.github/workflows/functional-basic.yaml b/.github/workflows/functional-basic.yaml index 722b1a5510..4464cb9d6d 100644 --- a/.github/workflows/functional-basic.yaml +++ b/.github/workflows/functional-basic.yaml @@ -41,10 +41,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-basic env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: '^internal/acceptance/openstack$' OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-blockstorage.yaml b/.github/workflows/functional-blockstorage.yaml index 91a60b4d4d..d49e028c1d 100644 --- a/.github/workflows/functional-blockstorage.yaml +++ b/.github/workflows/functional-blockstorage.yaml @@ -40,10 +40,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-blockstorage env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: ^.*blockstorage(.(?!noauth).*)?$ OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-clustering.yaml b/.github/workflows/functional-clustering.yaml index daca0d8d33..c59d8cebb8 100644 --- a/.github/workflows/functional-clustering.yaml +++ b/.github/workflows/functional-clustering.yaml @@ -42,10 +42,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-clustering env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^.*clustering.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-compute.yaml b/.github/workflows/functional-compute.yaml index 92d2371fb0..c19aba81b5 100644 --- a/.github/workflows/functional-compute.yaml +++ b/.github/workflows/functional-compute.yaml @@ -39,10 +39,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-compute env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^.*compute.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-containerinfra.yaml b/.github/workflows/functional-containerinfra.yaml index 73c6ef6ae6..65db10c1ba 100644 --- a/.github/workflows/functional-containerinfra.yaml +++ b/.github/workflows/functional-containerinfra.yaml @@ -57,10 +57,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-containerinfra env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^.*containerinfra.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-dns.yaml b/.github/workflows/functional-dns.yaml index 6fe7d99547..d5d0caf68a 100644 --- a/.github/workflows/functional-dns.yaml +++ b/.github/workflows/functional-dns.yaml @@ -41,10 +41,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-dns env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^acceptance/openstack/dns.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-fwaas_v2.yaml b/.github/workflows/functional-fwaas_v2.yaml index ae31ef344d..b3fe165454 100644 --- a/.github/workflows/functional-fwaas_v2.yaml +++ b/.github/workflows/functional-fwaas_v2.yaml @@ -45,10 +45,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-networking env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^.*fwaas_v2.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-identity.yaml b/.github/workflows/functional-identity.yaml index 5a365ac9d4..94a3f3e513 100644 --- a/.github/workflows/functional-identity.yaml +++ b/.github/workflows/functional-identity.yaml @@ -37,10 +37,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-identity env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^.*identity.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-image.yaml b/.github/workflows/functional-image.yaml index e9f557c1d4..d5db9c8103 100644 --- a/.github/workflows/functional-image.yaml +++ b/.github/workflows/functional-image.yaml @@ -37,10 +37,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-image env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^.*image.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-keymanager.yaml b/.github/workflows/functional-keymanager.yaml index b1d02ef6f7..1446745129 100644 --- a/.github/workflows/functional-keymanager.yaml +++ b/.github/workflows/functional-keymanager.yaml @@ -40,10 +40,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-keymanager env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^.*keymanager.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-loadbalancer.yaml b/.github/workflows/functional-loadbalancer.yaml index 1c669aed77..46d5304d61 100644 --- a/.github/workflows/functional-loadbalancer.yaml +++ b/.github/workflows/functional-loadbalancer.yaml @@ -41,10 +41,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-loadbalancer env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^.*loadbalancer.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-messaging.yaml b/.github/workflows/functional-messaging.yaml index c4ba4b6e82..5f20c60b17 100644 --- a/.github/workflows/functional-messaging.yaml +++ b/.github/workflows/functional-messaging.yaml @@ -40,10 +40,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-messaging env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^.*messaging.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-networking.yaml b/.github/workflows/functional-networking.yaml index 7db740ea9c..88df59aff6 100644 --- a/.github/workflows/functional-networking.yaml +++ b/.github/workflows/functional-networking.yaml @@ -54,10 +54,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-networking env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^(?!.*fwaas_v2.*).*networking.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-objectstorage.yaml b/.github/workflows/functional-objectstorage.yaml index a4f347eaa4..4ed40e303d 100644 --- a/.github/workflows/functional-objectstorage.yaml +++ b/.github/workflows/functional-objectstorage.yaml @@ -44,10 +44,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-objectstorage env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: '^.*objectstorage.*$' OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-orchestration.yaml b/.github/workflows/functional-orchestration.yaml index 816bf55ad6..cccaa45ecb 100644 --- a/.github/workflows/functional-orchestration.yaml +++ b/.github/workflows/functional-orchestration.yaml @@ -40,10 +40,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-orchestration env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: ^.*orchestration.*$ OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-placement.yaml b/.github/workflows/functional-placement.yaml index 486769f130..d5bbe13e7f 100644 --- a/.github/workflows/functional-placement.yaml +++ b/.github/workflows/functional-placement.yaml @@ -37,10 +37,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-placement env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: ^.*placement.*$ OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/.github/workflows/functional-sharedfilesystems.yaml b/.github/workflows/functional-sharedfilesystems.yaml index 24dc989fcc..94ee6ae2ba 100644 --- a/.github/workflows/functional-sharedfilesystems.yaml +++ b/.github/workflows/functional-sharedfilesystems.yaml @@ -53,10 +53,9 @@ jobs: with: go-version: '^1.20' - name: Run Gophercloud acceptance tests - run: ./script/acceptancetest + run: make acceptance-sharedfilesystem env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^.*sharedfilesystems.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs diff --git a/internal/acceptance/README.md b/internal/acceptance/README.md index cbbbac7f39..febf394f10 100644 --- a/internal/acceptance/README.md +++ b/internal/acceptance/README.md @@ -91,7 +91,13 @@ to set them manually. From the root directory, run: ``` -./script/acceptancetest +make acceptance +``` + +You can also run tests for a specific service: + +``` +make acceptance-compute ``` Alternatively, add the following to your `.bashrc`: diff --git a/script/acceptancetest b/script/acceptancetest deleted file mode 100755 index 9e540b2d84..0000000000 --- a/script/acceptancetest +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -set -x -set -o pipefail - -source `dirname $0`/stackenv - -timeout="60m" -failed= - -if [[ -z "${LOG_DIR}" ]]; then - echo "LOG_DIR not set, will set a temp directory" - LOG_DIR=/tmp/devstack-logs -fi -mkdir -p ${LOG_DIR} - -if [[ -z "${ACCEPTANCE_TESTS_FILTER}" ]]; then - ACCEPTANCE_TESTS=$(find internal/acceptance/openstack -name '*_test.go' -exec dirname {} \; | sort -n | uniq) -else - ACCEPTANCE_TESTS=$(find internal/acceptance/openstack -name '*_test.go' -exec dirname {} \; | sort -n | uniq | grep -P "$ACCEPTANCE_TESTS_FILTER") -fi -ACCEPTANCE_TESTS=($ACCEPTANCE_TESTS) - -if [[ -z $ACCEPTANCE_TESTS ]]; then - echo "No acceptance tests to run" - exit 0 -fi - -for acceptance_test in "${ACCEPTANCE_TESTS[@]}"; do - go test -v -timeout $timeout -tags "fixtures acceptance" ./${acceptance_test} |& tee -a ${LOG_DIR}/acceptance_tests.log - # Check the error code after each suite, but do not exit early if a suite failed. - if [[ $? != 0 ]]; then - failed=1 - fi -done - -# If any of the test suites failed, exit 1 -if [[ -n $failed ]]; then - exit 1 -fi - -exit 0