Skip to content

Commit

Permalink
.github: update system tests flow for new dev env
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeniy Zayats <[email protected]>
  • Loading branch information
Evgeniy Zayats committed Apr 2, 2024
1 parent ca52b60 commit fcfd406
Showing 1 changed file with 82 additions and 111 deletions.
193 changes: 82 additions & 111 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ jobs:
with:
path: neofs-s3-gw

- name: Checkout neofs-dev-env repository
uses: actions/checkout@v4
with:
repository: nspcc-dev/neofs-dev-env
ref: 'af001f8052a203eab408af2bf3a41c7e5af2ac11'
path: neofs-dev-env

#################################################################
- name: Set up Go
uses: actions/setup-go@v5
Expand All @@ -69,7 +62,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10.11'
python-version: '3.12'
- run: python --version

# Hashlib uses OpenSSL for ripemd160 and apparently OpenSSL disabled some older crypto algos around version 3.0
Expand All @@ -96,80 +89,98 @@ jobs:
sudo python ./tools/src/openssl_config_fix.py
working-directory: neofs-testcases

################################################################
- name: Get TAG for docker images
- name: Build neofs-s3-gw binaries
run: |
echo "CURRENT_TAG=$( make version | sed 's/^v//' )" >> $GITHUB_ENV
make all
working-directory: neofs-s3-gw

- name: Build neofs-s3-gw docker image
run: |
make
working-directory: neofs-s3-gw
- name: Download latest stable neofs-adm
uses: dsaltares/[email protected]
with:
repo: 'nspcc-dev/neofs-node'
version: 'tags/v0.40.1'
file: 'neofs-adm-linux-amd64'
target: 'neofs-testcases/neofs-adm'

- name: Build neofs-s3-gw binaries
run: |
make image
working-directory: neofs-s3-gw
- name: Download latest stable neofs-cli
uses: dsaltares/[email protected]
with:
repo: 'nspcc-dev/neofs-node'
version: 'tags/v0.40.1'
file: 'neofs-cli-linux-amd64'
target: 'neofs-testcases/neofs-cli'

- name: Add NeoFS S3-gw TAGs to s3-gw-test env config
run: |
sed -i -e 's/S3_GW_VERSION=_TAG_/S3_GW_VERSION=${{ env.CURRENT_TAG }}/' .github/testcases-env
working-directory: neofs-s3-gw
- name: Download latest stable neofs-ir
uses: dsaltares/[email protected]
with:
repo: 'nspcc-dev/neofs-node'
version: 'tags/v0.40.1'
file: 'neofs-ir-linux-amd64'
target: 'neofs-testcases/neofs-ir'

- name: Copy testcases-env file to .env for neofs-dev-env
run: |
cp .github/testcases-env ${GITHUB_WORKSPACE}/neofs-dev-env/.env
working-directory: neofs-s3-gw
- name: Download latest stable neofs-lens
uses: dsaltares/[email protected]
with:
repo: 'nspcc-dev/neofs-node'
version: 'tags/v0.40.1'
file: 'neofs-lens-linux-amd64'
target: 'neofs-testcases/neofs-lens'

################################################################
- name: Download latest stable neofs-node
uses: dsaltares/[email protected]
with:
repo: 'nspcc-dev/neofs-node'
version: 'tags/v0.40.1'
file: 'neofs-node-linux-amd64'
target: 'neofs-testcases/neofs-node'

- name: Prepare hosts
timeout-minutes: 5
run: |
make get
sudo ./bin/update_hosts.sh
sudo chmod a+w vendor/hosts
working-directory: neofs-dev-env
- name: Download latest stable neofs-rest-gw
uses: dsaltares/[email protected]
with:
repo: 'nspcc-dev/neofs-rest-gw'
version: 'tags/v0.7.2'
file: 'neofs-rest-gw-linux-amd64'
target: 'neofs-testcases/neofs-rest-gw'

- name: Download latest stable neo-go
uses: dsaltares/[email protected]
with:
repo: 'nspcc-dev/neo-go'
version: 'tags/v0.104.0'
file: 'neo-go-linux-amd64'
target: 'neofs-testcases/neo-go'

- name: Prepare venv
timeout-minutes: 30
run: |
make venv.local-pytest
make venv.pytest
echo "$(pwd)" >> $GITHUB_PATH
working-directory: neofs-testcases

- name: Prepare Dev-Env to run tests
id: prepare_test_env
timeout-minutes: 30
- name: Copy neofs-s3-gw binaries to testcases directory
run: |
make prepare-test-env
echo "$(pwd)/vendor" >> $GITHUB_PATH
working-directory: neofs-dev-env
cp bin/* ${GITHUB_WORKSPACE}/neofs-testcases/
working-directory: neofs-s3-gw

- name: Copy neofs-s3-gw binaries to vendor directory
- name: Chmod binaries
run: |
cp bin/* ${GITHUB_WORKSPACE}/neofs-dev-env/vendor/
working-directory: neofs-s3-gw
sudo chmod a+x neofs-cli
sudo chmod a+x neofs-adm
sudo chmod a+x neofs-ir
sudo chmod a+x neofs-lens
sudo chmod a+x neofs-node
sudo chmod a+x neofs-rest-gw
sudo chmod a+x neo-go
sudo chmod a+x neofs-s3-authmate
sudo chmod a+x neofs-s3-gw
working-directory: neofs-testcases

################################################################
- name: Log environment
run: |
echo "Check free space"
df -h
echo "=========================================="
echo "Check /etc/hosts"
cat /etc/hosts
echo "=========================================="
echo "Check docker images"
docker images
echo "=========================================="
echo "Check docker ps"
docker ps
echo "=========================================="
echo "Check neo-go version"
neo-go --version
echo "=========================================="
Expand All @@ -187,33 +198,30 @@ jobs:
neofs-adm --version
echo "=========================================="
echo "Check neofs-ir version"
neofs-ir --version
echo "=========================================="
echo "Check neofs-lens version"
neofs-lens --version
echo "=========================================="
echo "Check neofs-cli version"
neofs-cli --version
echo "=========================================="
echo "Check vendor dir"
ls -lah "${GITHUB_WORKSPACE}/neofs-dev-env/vendor"
echo "Check current dir"
ls -lah
echo "=========================================="
working-directory: neofs-testcases

working-directory: neofs-dev-env

################################################################
- name: Run Sanity tests for pull requests
- name: Run s3 gw e2e tests
timeout-minutes: 120
if: github.event_name == 'pull_request'
run: |
source venv.local-pytest/bin/activate && pytest --show-capture=no -m "sanity" --alluredir=${{ env.ALLURE_RESULTS_DIR }} pytest_tests/testsuites/services/s3_gate
source venv.pytest/bin/activate && pytest --alluredir=${{ env.ALLURE_RESULTS_DIR }} pytest_tests/tests/services/s3_gate
working-directory: neofs-testcases

- name: Run all tests for other events
timeout-minutes: 480
if: github.event_name != 'pull_request'
run: |
source venv.local-pytest/bin/activate && pytest --show-capture=no --alluredir=${{ env.ALLURE_RESULTS_DIR }} pytest_tests/testsuites/services/s3_gate
working-directory: neofs-testcases

################################################################

- name: Publish to NeoFS
id: put_report
if: always() && steps.prepare_test_env.outcome == 'success'
Expand Down Expand Up @@ -244,40 +252,3 @@ jobs:
state: 'success'
sha: ${{github.event.pull_request.head.sha || github.sha}}
target_url: ${{ env.REPORT_NEOFS_URL }}

- name: Set docker logs directory
run: echo "DOCKER_LOGS=${{ github.workspace }}/${{ vars.TEST_RESULTS_CID }}/${{ env.RUN_ID }}/data/docker-logs" >> $GITHUB_ENV

- name: Gather docker logs
id: gather_dockers_logs
if: always() && ( steps.prepare_test_env.outcome != 'success' || steps.put_report.outcome != 'success' )
run: |
source venv.local-pytest/bin/activate
mkdir -p ${{ env.DOCKER_LOGS }} && cd ${{ env.DOCKER_LOGS }}
python ${{ github.workspace }}/neofs-testcases/tools/src/zip_dev_env_logs.py
working-directory: neofs-testcases

- name: Post only docker logs
uses: nspcc-dev/gh-push-to-neofs@master
id: post_dockers_logs
if: steps.gather_dockers_logs.outcome == 'success'
with:
NEOFS_WALLET: ${{ secrets.TEST_RESULTS_WALLET }}
NEOFS_WALLET_PASSWORD: ${{ secrets.TEST_RESULTS_PASSWORD }}
NEOFS_NETWORK_DOMAIN: ${{ vars.TEST_RESULTS_NEOFS_NETWORK_DOMAIN }}
NEOFS_HTTP_GATE: ${{ vars.TEST_RESULTS_HTTP_GATE }}
STORE_OBJECTS_CID: ${{ vars.TEST_RESULTS_CID }}
LIFETIME: ${{ vars.OTHER_EXPIRATION_PERIOD }}
PATH_TO_FILES_DIR: ${{ env.DOCKER_LOGS }}
URL_PREFIX: ${{ env.RUN_ID }}/data

- name: Post link to docker logs
timeout-minutes: 60
if: steps.post_dockers_logs.outcome == 'success'
uses: Sibz/github-status-action@v1
with:
authToken: ${{secrets.GITHUB_TOKEN}}
context: 'Docker logs'
state: 'success'
sha: ${{github.event.pull_request.head.sha || github.sha}}
target_url: https://${{ vars.TEST_RESULTS_HTTP_GATE }}/${{ vars.TEST_RESULTS_CID }}/${{ env.RUN_ID }}/data/docker-logs/containers_logs.zip

0 comments on commit fcfd406

Please sign in to comment.