Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split test running in CI #440

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 60 additions & 2 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ jobs:
functional-das:
name: "DAS"
runs-on: ubuntu-latest
strategy:
matrix:
pytest-group: [ "1", "2", "3"]

steps:
- name: Checkout RSTUF Worker source code
Expand All @@ -72,11 +75,66 @@ jobs:

- name: Bootstrap/Setup RSTUF DAS and run Functional Tests
run: |
make ft-das CLI_VERSION=${{ inputs.cli_version }}
make ft-das CLI_VERSION=${{ inputs.cli_version }} PYTEST_GROUP=${{ matrix.pytest-group }}

functional-das-slow:
name: "DAS Slow"
runs-on: ubuntu-latest

steps:
- name: Checkout RSTUF Worker source code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Checkout RSTUF Umbrella (FT)
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
repository: repository-service-tuf/repository-service-tuf
path: rstuf-umbrella
ref: ${{ inputs.umbrella_branch }}

- name: Deploy RSTUF with Worker container from source code
uses: isbang/compose-action@178aeba5c9dbeed89ffffbb3e6548ec08e9839cf
with:
compose-file: ${{ inputs.docker_compose }}
env:
API_VERSION: ${{ inputs.api_version }}

- name: Bootstrap/Setup RSTUF DAS and run Functional Tests
run: |
make ft-das CLI_VERSION=${{ inputs.cli_version }} PYTEST_GROUP=none SLOW="yes"

functional-signed:
name: "Signed"
runs-on: ubuntu-latest
strategy:
matrix:
pytest-group: [ "1", "2", "3"]

steps:
- name: Checkout RSTUF Worker source code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Checkout RSTUF Umbrella (FT)
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
repository: repository-service-tuf/repository-service-tuf
path: rstuf-umbrella
ref: ${{ inputs.umbrella_branch }}

- name: Deploy RSTUF with Worker container from source code
uses: isbang/compose-action@178aeba5c9dbeed89ffffbb3e6548ec08e9839cf
with:
compose-file: ${{ inputs.docker_compose }}
env:
API_VERSION: ${{ inputs.api_version }}

- name: Bootstrap/Setup RSTUF full Signed and run Functional Tests
run: |
make ft-signed CLI_VERSION=${{ inputs.cli_version }} PYTEST_GROUP=${{ matrix.pytest-group }}

functional-signed-slow:
name: "Signed Slow"
runs-on: ubuntu-latest

steps:
- name: Checkout RSTUF Worker source code
Expand All @@ -98,4 +156,4 @@ jobs:

- name: Bootstrap/Setup RSTUF full Signed and run Functional Tests
run: |
make ft-signed CLI_VERSION=${{ inputs.cli_version }}
make ft-signed CLI_VERSION=${{ inputs.cli_version }} PYTEST_GROUP=none SLOW="yes"
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ ft-das:
ifeq ($(GITHUB_ACTION),)
$(MAKE) clone-umbrella
endif
docker compose run --env UMBRELLA_PATH=rstuf-umbrella --entrypoint 'bash tests/functional/scripts/run-ft-das.sh $(CLI_VERSION)' --rm repository-service-tuf-worker
docker compose run --env UMBRELLA_PATH=rstuf-umbrella --entrypoint 'bash tests/functional/scripts/run-ft-das.sh $(CLI_VERSION) $(PYTEST_GROUP) $(SLOW)' --rm repository-service-tuf-worker

ft-signed:
# Use "GITHUB_ACTION" to identify if we are running from a GitHub action.
ifeq ($(GITHUB_ACTION),)
$(MAKE) clone-umbrella
endif
docker compose run --env UMBRELLA_PATH=rstuf-umbrella --entrypoint 'bash tests/functional/scripts/run-ft-signed.sh $(CLI_VERSION)' --rm repository-service-tuf-worker
docker compose run --env UMBRELLA_PATH=rstuf-umbrella --entrypoint 'bash tests/functional/scripts/run-ft-signed.sh $(CLI_VERSION) $(PYTEST_GROUP) $(SLOW)' --rm repository-service-tuf-worker
4 changes: 3 additions & 1 deletion tests/functional/scripts/run-ft-das.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash -x

CLI_VERSION=$1
PYTEST_GROUP=$2
SLOW=$3
# Install required dependencies for Functional Tests
apt update
apt install -y make wget git curl
Expand Down Expand Up @@ -116,5 +118,5 @@ python ${UMBRELLA_PATH}/tests/functional/scripts/rstuf-admin-metadata-update.py

cp ./metadata-update-payload.json ${UMBRELLA_PATH}

make -C ${UMBRELLA_PATH}/ functional-tests-exitfirst
make -C ${UMBRELLA_PATH}/ functional-tests-exitfirst PYTEST_GROUP=${PYTEST_GROUP} SLOW=${SLOW}

4 changes: 3 additions & 1 deletion tests/functional/scripts/run-ft-signed.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash -x

CLI_VERSION=$1
PYTEST_GROUP=$2
SLOW=$3
# Install required dependencies for Functional Tests
apt update
apt install -y make wget git curl
Expand Down Expand Up @@ -98,5 +100,5 @@ python ${UMBRELLA_PATH}/tests/functional/scripts/rstuf-admin-metadata-update.py

cp ./metadata-update-payload.json ${UMBRELLA_PATH}

make -C ${UMBRELLA_PATH}/ functional-tests-exitfirst
make -C ${UMBRELLA_PATH}/ functional-tests-exitfirst PYTEST_GROUP=${PYTEST_GROUP} SLOW=${SLOW}

Loading