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

Update conductor system tests #76

Merged
merged 1 commit into from
Nov 5, 2024
Merged
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
37 changes: 15 additions & 22 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
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: |
Expand All @@ -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/[email protected]
Expand All @@ -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
Loading