diff --git a/.github/workflows/system-tests.yml b/.github/workflows/system-tests.yml index fe02d21..0e5efe3 100644 --- a/.github/workflows/system-tests.yml +++ b/.github/workflows/system-tests.yml @@ -18,49 +18,38 @@ jobs: poetry-version: ["1.4.2"] runs-on: ubuntu-latest timeout-minutes: 60 + + steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + + - name: Run image uses: abatilo/actions-poetry@v2 with: poetry-version: ${{ matrix.poetry-version }} + + - name: Install package dependencies run: poetry install - name: Execute worker and dependency run: | docker compose -f tests/execute_sdk/docker-compose.yml up -d sleep 20 # TODO ADD HEALTHCHECK TO WORKER + + - name: Run system tests - continue-on-error: true run: | export CONDUCTOR_URL_BASE="http://localhost:8080/api/" mkdir -p logs - echo "measure_duration_start=$(date +%s)" >> "$GITHUB_ENV" poetry run pytest tests/system_tests/ -vv \ - --collect-stats-folder="ga_workflows_collected_data/" \ --junit-xml=logs/test-results.xml \ --log-file=logs/pytest_log_file.log - - name: Execute tests - measure duration - continue-on-error: true - run: | - DURATION=$(( ($(date +%s) - ${{ env.measure_duration_start }}) /60 )) - FRINX_CONDUCTOR_VERSION=$(docker container inspect $(docker ps --filter name=conductor-server -q) --format '{{ .Config.Labels.git_commit }}') - FRINX_CONDUCTOR_WORKERS_AND_PYTHON_SDK_VERSION=$(git describe --tags --always) - filename=$(echo ${{ github.workflow }} | sed 's| |_|g') - echo "$(date +%s)000,${{ github.workflow }},${{ github.run_id }},${{ github.event_name }},${{ job.status }},${FRINX_CONDUCTOR_VERSION}+${FRINX_CONDUCTOR_WORKERS_AND_PYTHON_SDK_VERSION},${DURATION}" >> ./ga_workflows_collected_data/$filename - cd ./ga_workflows_collected_data - git status - git diff > ../logs/ga_workflows_collected_data.diff - git config -l --show-scope - git config --global user.email "support@frinx.io" - git config --global user.name "FRINXrepo" - git add $filename ${filename}.json - git commit -am "${{ github.workflow }} tests in ${DURATION} minutes" - git pull -r -# git push -f origin main + + - name: Collect logs to file if: ${{ always() }} run: | @@ -70,6 +59,8 @@ jobs: docker container logs $container &> logs/$container.log docker container inspect $container &> logs/${container}_inspect.json done + + - name: Upload pytest logs if: ${{ always() }} uses: actions/upload-artifact@v3.1.1 @@ -79,8 +70,10 @@ jobs: ${{ github.workspace }}/logs/ if-no-files-found: error retention-days: 1 + + - name: Surface failing tests if: ${{ always() }} uses: pmeier/pytest-results-action@main with: - path: logs/test-results.xml + path: logs/test-results.xml \ No newline at end of file