*: Upgrade to the latest github.com/nspcc-dev/neofs-sdk-go
revision
#221
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: S3 tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
- support/** | |
types: [opened, synchronize] | |
paths-ignore: | |
- '**/*.md' | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
inputs: | |
neofs-s3-gw_ref: | |
description: 'neofs-s3-gw ref. Default ref - latest master. Examples: v0.27.0, 8fdcc6d7e798e6511be8806b81894622e72d7fdc, branch_name' | |
required: false | |
default: '' | |
permissions: write-all | |
env: | |
S3_TESTS_CONFIG: s3tests.conf | |
ALLURE_RESULTS_DIR: ${{ github.workspace }}/allure-results | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get the current date | |
id: date | |
shell: bash | |
run: echo "::set-output name=timestamp::$(date +%s)" | |
- name: Set RUN_ID | |
env: | |
TIMESTAMP: ${{ steps.date.outputs.timestamp }} | |
run: echo "RUN_ID=${{ github.run_number }}-$TIMESTAMP" >> $GITHUB_ENV | |
- name: Checkout neofs-s3-gw repository | |
uses: actions/checkout@v4 | |
with: | |
path: neofs-s3-gw | |
- name: Checkout s3-tests repository | |
uses: actions/checkout@v4 | |
with: | |
repository: nspcc-dev/s3-tests | |
ref: master | |
path: s3-tests | |
- name: Checkout neofs-dev-env repository | |
uses: actions/checkout@v4 | |
with: | |
repository: nspcc-dev/neofs-dev-env | |
ref: 'af001f8052a203eab408af2bf3a41c7e5af2ac11' | |
path: neofs-dev-env | |
- name: Checkout neofs-s3-dev-env repository | |
uses: actions/checkout@v4 | |
with: | |
repository: nspcc-dev/neofs-s3-dev-env | |
ref: master | |
path: neofs-s3-dev-env | |
- name: Checkout neofs-testcases repository | |
uses: actions/checkout@v4 | |
with: | |
repository: nspcc-dev/neofs-testcases | |
ref: 'master' | |
path: neofs-testcases | |
################################################################ | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
cache: true | |
go-version: '1.22' | |
- run: go version | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
- run: python --version | |
################################################################ | |
- name: Get TAG for docker images | |
run: | | |
echo "CURRENT_TAG=$( make version | sed 's/^v//' )" >> $GITHUB_ENV | |
working-directory: neofs-s3-gw | |
################################################################ | |
- name: Build neofs-s3-gw docker image | |
run: | | |
make | |
working-directory: neofs-s3-gw | |
- name: Build neofs-s3-gw binaries | |
run: | | |
make image | |
working-directory: neofs-s3-gw | |
################################################################# | |
- 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/test-env | |
working-directory: neofs-s3-gw | |
- name: Copy test-env file to .env for neofs-dev-env | |
run: | | |
cp .github/test-env ${GITHUB_WORKSPACE}/neofs-dev-env/.env | |
working-directory: neofs-s3-gw | |
################################################################ | |
- 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: Prepare Dev-Env to run tests | |
id: prepare_test_env | |
timeout-minutes: 30 | |
run: | | |
make prepare-test-env | |
echo "$(pwd)/vendor" >> $GITHUB_PATH | |
working-directory: neofs-dev-env | |
- name: Set zero fee | |
run: | | |
make update.container_fee val=0 && make update.container_alias_fee val=0 | |
working-directory: neofs-dev-env | |
- name: Copy neofs-s3-gw binaries to vendor directory | |
run: | | |
cp bin/* ${GITHUB_WORKSPACE}/neofs-dev-env/vendor/ | |
working-directory: neofs-s3-gw | |
################################################################ | |
- 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 "==========================================" | |
echo "Check neofs-s3-authmate version" | |
neofs-s3-authmate --version | |
echo "==========================================" | |
echo "Check neofs-s3-gw version" | |
echo "==========================================" | |
neofs-s3-gw --version | |
echo "==========================================" | |
echo "Check neofs-adm version" | |
neofs-adm --version | |
echo "==========================================" | |
echo "Check neofs-cli version" | |
neofs-cli --version | |
echo "==========================================" | |
echo "Check vendor dir" | |
ls -lah "${GITHUB_WORKSPACE}/neofs-dev-env/vendor" | |
echo "==========================================" | |
working-directory: neofs-dev-env | |
################################################################ | |
- name: Copy test-env file to .env for neofs-s3-dev-env | |
run: | | |
cp .env ${GITHUB_WORKSPACE}/neofs-s3-dev-env/.env | |
working-directory: neofs-dev-env | |
- name: Copy neofs-s3-authmate for neofs-s3-dev-env | |
run: | | |
cp ${GITHUB_WORKSPACE}/neofs-dev-env/vendor/neofs-s3-authmate bin/s3-authmate | |
working-directory: neofs-s3-dev-env | |
- name: Prepare test S3-gw test env | |
run: | | |
make prepare.s3-gw | |
working-directory: neofs-s3-dev-env | |
- name: Copy s3tests config to s3-tests directory | |
run: | | |
cp services/s3-gw/s3tests.conf ${GITHUB_WORKSPACE}/s3-tests/${S3_TESTS_CONFIG} | |
working-directory: neofs-s3-dev-env | |
- name: Test config | |
run: | | |
cat ${S3_TESTS_CONFIG} | |
working-directory: s3-tests | |
- name: Setup test env | |
run: | | |
python3.8 -m venv virtualenv | |
./bootstrap | |
working-directory: s3-tests | |
- name: s3 tests | |
run: | | |
source virtualenv/bin/activate | |
S3TEST_CONF=${S3_TESTS_CONFIG} pytest -m 'not fails_on_aws and not fails_on_dbstore' --alluredir=${{ env.ALLURE_RESULTS_DIR }} -v -s s3tests_boto3/functional/test_s3.py s3tests_boto3/functional/test_s3.py | |
working-directory: s3-tests | |
################################################################ | |
- name: Publish to NeoFS | |
id: put_report | |
if: always() && steps.prepare_test_env.outcome == 'success' | |
uses: nspcc-dev/gh-push-allure-report-to-neofs@master | |
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 }} | |
PR_LIFETIME: ${{ vars.PR_EXPIRATION_PERIOD }} | |
MASTER_LIFETIME: ${{ vars.MASTER_EXPIRATION_PERIOD }} | |
MANUAL_RUN_LIFETIME: ${{ vars.MANUAL_RUN_EXPIRATION_PERIOD }} | |
OTHER_LIFETIME: ${{ vars.OTHER_EXPIRATION_PERIOD }} | |
ALLURE_RESULTS_DIR: ${{ env.ALLURE_RESULTS_DIR }} | |
ALLURE_GENERATED_DIR: 'neofs-test-allure-generated-report' | |
- name: Post link to s3 tests report | |
id: post_report_link | |
timeout-minutes: 60 | |
if: always() && steps.put_report.outcome == 'success' | |
env: | |
REPORT_NEOFS_URL: ${{ steps.put_report.outputs.REPORT_NEOFS_URL }}index.html | |
uses: Sibz/github-status-action@v1 | |
with: | |
authToken: ${{secrets.GITHUB_TOKEN}} | |
context: 'S3 tests report' | |
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 |