From 30103dd5d827bd5a9d33b3910681320469f1f16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Mon, 26 Feb 2024 11:27:05 +0000 Subject: [PATCH] [skip] Adjust github workflows files * Add test workflows based on salt-test (#616) * Add unit test workflow based on salt-test * Add integration test workflow based on salt-test * Adjust GH actions to run all tests subsets and include functional * Add new GH action to trigger scenarios tests * GH Actions: Fix Salt version in _version.txt file When GH Actions are executed, they skip the default entrypoint for the container, so we need to arrange the _version.txt file manually Propagate GITHUB_ACTIONS variable to container environment --- .../functional-fast-opensuse-leap.yml | 26 +++++++++++++ .../functional-full-opensuse-leap.yml | 26 +++++++++++++ .../workflows/functional-opensuse-leap.yml | 39 ------------------- .../integration-fast-opensuse-leap.yml | 26 +++++++++++++ .../integration-full-opensuse-leap.yml | 26 +++++++++++++ .../workflows/integration-opensuse-leap.yml | 39 ------------------- .../scenarios-fast-opensuse-leap.yml | 26 +++++++++++++ .../scenarios-full-opensuse-leap.yml | 26 +++++++++++++ .github/workflows/unit-fast-opensuse-leap.yml | 26 +++++++++++++ .github/workflows/unit-full-opensuse-leap.yml | 26 +++++++++++++ .github/workflows/unit-opensuse-leap.yml | 39 ------------------- 11 files changed, 208 insertions(+), 117 deletions(-) create mode 100644 .github/workflows/functional-fast-opensuse-leap.yml create mode 100644 .github/workflows/functional-full-opensuse-leap.yml delete mode 100644 .github/workflows/functional-opensuse-leap.yml create mode 100644 .github/workflows/integration-fast-opensuse-leap.yml create mode 100644 .github/workflows/integration-full-opensuse-leap.yml delete mode 100644 .github/workflows/integration-opensuse-leap.yml create mode 100644 .github/workflows/scenarios-fast-opensuse-leap.yml create mode 100644 .github/workflows/scenarios-full-opensuse-leap.yml create mode 100644 .github/workflows/unit-fast-opensuse-leap.yml create mode 100644 .github/workflows/unit-full-opensuse-leap.yml delete mode 100644 .github/workflows/unit-opensuse-leap.yml diff --git a/.github/workflows/functional-fast-opensuse-leap.yml b/.github/workflows/functional-fast-opensuse-leap.yml new file mode 100644 index 0000000000..8186124c01 --- /dev/null +++ b/.github/workflows/functional-fast-opensuse-leap.yml @@ -0,0 +1,26 @@ +name: Fast functional tests + +on: + push: + branches: [openSUSE/release/3006.0] + pull_request: + branches: [openSUSE/release/3006.0] + workflow_dispatch: + +jobs: + fast-functional-tests: + runs-on: ubuntu-latest + env: + GITHUB_ACTIONS: 1 + container: + image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5 + options: --hostname=salt-test-container + steps: + - name: Checkout Salt + uses: actions/checkout@v4 + - name: Fix the Salt version in _version.txt file + run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt + - name: Run Fast functional tests + run: | + salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \ + --directory . --package-flavor classic functional -- -vvv diff --git a/.github/workflows/functional-full-opensuse-leap.yml b/.github/workflows/functional-full-opensuse-leap.yml new file mode 100644 index 0000000000..39e64101d4 --- /dev/null +++ b/.github/workflows/functional-full-opensuse-leap.yml @@ -0,0 +1,26 @@ +name: Full functional tests + +on: + push: + branches: [openSUSE/release/3006.0] + pull_request: + branches: [openSUSE/release/3006.0] + workflow_dispatch: + +jobs: + full-functional-tests: + runs-on: ubuntu-latest + env: + GITHUB_ACTIONS: 1 + container: + image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5 + options: --hostname=salt-test-container + steps: + - name: Checkout Salt + uses: actions/checkout@v4 + - name: Fix the Salt version in _version.txt file + run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt + - name: Run Full functional tests + run: | + salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \ + --directory . --package-flavor classic functional -- --core-tests --slow --run-expensive --ssh-tests --run-destructive -vvv diff --git a/.github/workflows/functional-opensuse-leap.yml b/.github/workflows/functional-opensuse-leap.yml deleted file mode 100644 index 46d5231b22..0000000000 --- a/.github/workflows/functional-opensuse-leap.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: functional-opensuse-leap - -on: - push: - branches: - - openSUSE/release/3006.0 - pull_request: - branches: - - openSUSE/release/3006.0 - workflow_dispatch: - -jobs: - functional-tests: - runs-on: ubuntu-latest - steps: - - name: Checkout Salt - uses: actions/checkout@v2 - with: - path: salt - - name: Checkout Salt Toaster - uses: actions/checkout@v2 - with: - repository: openSUSE/salt-toaster - path: salt-toaster - ref: 3006 - - name: Functional tests - env: - # The "ghcr.io/opensuse/salt-toaster-leap15.4-devel" package is currently private. - # Uncomment DOCKER_IMAGE once the image is public. - # - # https://github.com/orgs/openSUSE/packages?repo_name=salt-toaster - # - # DOCKER_IMAGE: "ghcr.io/opensuse/salt-toaster-leap15.4-devel" - DISTRO: "leap15.4" - FLAVOR: "devel" - SALT_REPO: "${{ github.workspace }}/salt" - PYTEST_FLAGS: "--run-slow --core-tests --run-destructive --ssh-tests --run-expensive -vvvv" - working-directory: ./salt-toaster - run: make saltstack.functional diff --git a/.github/workflows/integration-fast-opensuse-leap.yml b/.github/workflows/integration-fast-opensuse-leap.yml new file mode 100644 index 0000000000..a14202c3d7 --- /dev/null +++ b/.github/workflows/integration-fast-opensuse-leap.yml @@ -0,0 +1,26 @@ +name: Fast integration tests + +on: + push: + branches: [openSUSE/release/3006.0] + pull_request: + branches: [openSUSE/release/3006.0] + workflow_dispatch: + +jobs: + fast-integration-tests: + runs-on: ubuntu-latest + env: + GITHUB_ACTIONS: 1 + container: + image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5 + options: --hostname=salt-test-container + steps: + - name: Checkout Salt + uses: actions/checkout@v4 + - name: Fix the Salt version in _version.txt file + run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt + - name: Run Fast integration tests + run: | + salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \ + --directory . --package-flavor classic integration -- -vvv diff --git a/.github/workflows/integration-full-opensuse-leap.yml b/.github/workflows/integration-full-opensuse-leap.yml new file mode 100644 index 0000000000..843e4539be --- /dev/null +++ b/.github/workflows/integration-full-opensuse-leap.yml @@ -0,0 +1,26 @@ +name: Full integration tests + +on: + push: + branches: [openSUSE/release/3006.0] + pull_request: + branches: [openSUSE/release/3006.0] + workflow_dispatch: + +jobs: + full-integration-tests: + runs-on: ubuntu-latest + env: + GITHUB_ACTIONS: 1 + container: + image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5 + options: --hostname=salt-test-container + steps: + - name: Checkout Salt + uses: actions/checkout@v4 + - name: Fix the Salt version in _version.txt file + run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt + - name: Run Full integration tests + run: | + salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \ + --directory . --package-flavor classic integration -- --core-tests --slow --run-expensive --ssh-tests --run-destructive -vvv diff --git a/.github/workflows/integration-opensuse-leap.yml b/.github/workflows/integration-opensuse-leap.yml deleted file mode 100644 index 88ca0bcc11..0000000000 --- a/.github/workflows/integration-opensuse-leap.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: integration-opensuse-leap - -on: - push: - branches: - - openSUSE/release/3006.0 - pull_request: - branches: - - openSUSE/release/3006.0 - workflow_dispatch: - -jobs: - integration-tests: - runs-on: ubuntu-latest - steps: - - name: Checkout Salt - uses: actions/checkout@v2 - with: - path: salt - - name: Checkout Salt Toaster - uses: actions/checkout@v2 - with: - repository: openSUSE/salt-toaster - path: salt-toaster - ref: 3006 - - name: Integration tests - env: - # The "ghcr.io/opensuse/salt-toaster-leap15.4-devel" package is currently private. - # Uncomment DOCKER_IMAGE once the image is public. - # - # https://github.com/orgs/openSUSE/packages?repo_name=salt-toaster - # - # DOCKER_IMAGE: "ghcr.io/opensuse/salt-toaster-leap15.4-devel" - DISTRO: "leap15.4" - FLAVOR: "devel" - SALT_REPO: "${{ github.workspace }}/salt" - PYTEST_FLAGS: "--run-slow --core-tests --run-destructive --ssh-tests --run-expensive -vvvv" - working-directory: ./salt-toaster - run: make saltstack.integration diff --git a/.github/workflows/scenarios-fast-opensuse-leap.yml b/.github/workflows/scenarios-fast-opensuse-leap.yml new file mode 100644 index 0000000000..0c9feec6e6 --- /dev/null +++ b/.github/workflows/scenarios-fast-opensuse-leap.yml @@ -0,0 +1,26 @@ +name: Fast scenarios tests + +on: + push: + branches: [openSUSE/release/3006.0] + pull_request: + branches: [openSUSE/release/3006.0] + workflow_dispatch: + +jobs: + fast-scenarios-tests: + runs-on: ubuntu-latest + env: + GITHUB_ACTIONS: 1 + container: + image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5 + options: --hostname=salt-test-container + steps: + - name: Checkout Salt + uses: actions/checkout@v4 + - name: Fix the Salt version in _version.txt file + run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt + - name: Run Fast scenarios tests + run: | + salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \ + --directory . --package-flavor classic scenarios -- -vvv diff --git a/.github/workflows/scenarios-full-opensuse-leap.yml b/.github/workflows/scenarios-full-opensuse-leap.yml new file mode 100644 index 0000000000..e240aaee03 --- /dev/null +++ b/.github/workflows/scenarios-full-opensuse-leap.yml @@ -0,0 +1,26 @@ +name: Full scenarios tests + +on: + push: + branches: [openSUSE/release/3006.0] + pull_request: + branches: [openSUSE/release/3006.0] + workflow_dispatch: + +jobs: + full-scenarios-tests: + runs-on: ubuntu-latest + env: + GITHUB_ACTIONS: 1 + container: + image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5 + options: --hostname=salt-test-container + steps: + - name: Checkout Salt + uses: actions/checkout@v4 + - name: Fix the Salt version in _version.txt file + run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt + - name: Run Full scenarios tests + run: | + salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \ + --directory . --package-flavor classic scenarios -- --core-tests --slow --run-expensive --ssh-tests --run-destructive -vvv diff --git a/.github/workflows/unit-fast-opensuse-leap.yml b/.github/workflows/unit-fast-opensuse-leap.yml new file mode 100644 index 0000000000..d7df480d6d --- /dev/null +++ b/.github/workflows/unit-fast-opensuse-leap.yml @@ -0,0 +1,26 @@ +name: Fast unit tests + +on: + push: + branches: [openSUSE/release/3006.0] + pull_request: + branches: [openSUSE/release/3006.0] + workflow_dispatch: + +jobs: + fast-unit-tests: + runs-on: ubuntu-latest + env: + GITHUB_ACTIONS: 1 + container: + image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5 + options: --hostname=salt-test-container + steps: + - name: Checkout Salt + uses: actions/checkout@v4 + - name: Fix the Salt version in _version.txt file + run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt + - name: Run Fast unit tests + run: | + salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \ + --directory . --package-flavor classic unit -- -vvv diff --git a/.github/workflows/unit-full-opensuse-leap.yml b/.github/workflows/unit-full-opensuse-leap.yml new file mode 100644 index 0000000000..0dbaef507d --- /dev/null +++ b/.github/workflows/unit-full-opensuse-leap.yml @@ -0,0 +1,26 @@ +name: Full unit tests + +on: + push: + branches: [openSUSE/release/3006.0] + pull_request: + branches: [openSUSE/release/3006.0] + workflow_dispatch: + +jobs: + full-unit-tests: + runs-on: ubuntu-latest + env: + GITHUB_ACTIONS: 1 + container: + image: registry.opensuse.org/systemsmanagement/saltstack/products/testing/containers/leap15.5/containers/salt-testsuite-github:leap15.5 + options: --hostname=salt-test-container + steps: + - name: Checkout Salt + uses: actions/checkout@v4 + - name: Fix the Salt version in _version.txt file + run: rpm -q python3-salt-testsuite --queryformat '%{VERSION}' > $GITHUB_WORKSPACE/salt/_version.txt + - name: Run Full unit tests + run: | + salt-test --skiplist https://raw.githubusercontent.com/openSUSE/salt-test-skiplist/main/skipped_tests.toml \ + --directory . --package-flavor classic unit -- --core-tests --slow --run-expensive --ssh-tests --run-destructive -vvv diff --git a/.github/workflows/unit-opensuse-leap.yml b/.github/workflows/unit-opensuse-leap.yml deleted file mode 100644 index 61ba4a0ed9..0000000000 --- a/.github/workflows/unit-opensuse-leap.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: unit-opensuse-leap - -on: - push: - branches: - - openSUSE/release/3006.0 - pull_request: - branches: - - openSUSE/release/3006.0 - workflow_dispatch: - -jobs: - unit-tests: - runs-on: ubuntu-latest - steps: - - name: Checkout Salt - uses: actions/checkout@v2 - with: - path: salt - - name: Checkout Salt Toaster - uses: actions/checkout@v2 - with: - repository: openSUSE/salt-toaster - path: salt-toaster - ref: 3006 - - name: Unit tests - env: - # The "ghcr.io/opensuse/salt-toaster-leap15.4-devel" package is currently private. - # Uncomment DOCKER_IMAGE once the image is public. - # - # https://github.com/orgs/openSUSE/packages?repo_name=salt-toaster - # - # DOCKER_IMAGE: "ghcr.io/opensuse/salt-toaster-leap15.4-devel" - DISTRO: "leap15.4" - FLAVOR: "devel" - SALT_REPO: "${{ github.workspace }}/salt" - PYTEST_FLAGS: "--run-slow --core-tests --run-destructive --ssh-tests --run-expensive -vvvv" - working-directory: ./salt-toaster - run: make saltstack.unit