From 611bb750a4f659bcbbb07956a321cb23f285bb0b Mon Sep 17 00:00:00 2001 From: Roshan Piyush Date: Tue, 6 Feb 2024 14:49:41 +0530 Subject: [PATCH] Fix tests --- .github/workflows/pr-build.yml | 11 +++++++---- services/workshop/runner.sh | 7 ------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 88dfc877..407335fd 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -35,14 +35,14 @@ jobs: PLATFORMS: "linux/amd64,linux/arm64" steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Env seen prerun run: env - name: Get branch name id: branch-name - uses: tj-actions/branch-names@v5.2 + uses: tj-actions/branch-names@@v8 - name: Current branch name run: | @@ -219,6 +219,8 @@ jobs: run: | cd services/community go test -v ./... + mkdir test-results + go test -json > test-results/TestResults.json - name: Run workshop tests run: | @@ -228,13 +230,13 @@ jobs: source venv/bin/activate pip3 install -r requirements.txt mkdir -p test-results - IS_TESTING=True python3 manage.py test --no-input --testrunner xmlrunner.extra.djangotestrunner.XMLTestRunner --output-dir test-results + IS_TESTING=True python3 manage.py test --no-input --testrunner xmlrunner.extra.djangotestrunner.XMLTestRunner - name: Run workshop coverage run: | cd services/workshop source venv/bin/activate - coverage run ./manage.py test crapi + IS_TESTING=True coverage run ./manage.py test --no-input crapi coverage report coverage xml -o coverage.xml @@ -244,6 +246,7 @@ jobs: with: files: | **/test-results/**/*.xml + **/test-results/**/*.json - name: Publish Coverage Report if: always() diff --git a/services/workshop/runner.sh b/services/workshop/runner.sh index 3dc4b9ab..27b85160 100755 --- a/services/workshop/runner.sh +++ b/services/workshop/runner.sh @@ -23,13 +23,6 @@ python3 manage.py migrate python3 manage.py check &&\ python3 manage.py health_check -## Uncomment the following line if you wish to run tests -if [ "$RUN_TESTS" = "true" ] || [ "$RUN_TESTS" = "1" ]; then - echo "Running tests" - IS_TESTING=True python3 manage.py test --no-input - echo "Tests finished" -fi - echo "Seeding the database" python3 manage.py seed_database