From 2a2b4f0874f29f7411194946dd0cbb37da686313 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 25 Sep 2023 16:55:58 -0700 Subject: [PATCH 01/48] Add scheduled tests. --- .github/workflows/scheduled_tests.yml | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/scheduled_tests.yml diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml new file mode 100644 index 00000000..07a0476e --- /dev/null +++ b/.github/workflows/scheduled_tests.yml @@ -0,0 +1,47 @@ +name: Utilities Tests + +# on: +# push: {} +# pull_request: +# branches: +# - master +on: workflow_dispatch + +jobs: + run_app_tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] + steps: + - name: Checkout source + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip + run: pip install --upgrade pip + + - name: Install dependencies + run: pip install -r requirements_web.txt + + - name: Install PyTest + run: pip install pytest + + - name: Run Pytest and Capture Report + id: pytest + run: | + pytest src/tests/test_remote.py --html=pytest_report.html + pytest_report_content=$(cat pytest_report.html) + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + - name: Send Report to Slack + run: | + curl -X POST -H 'Content-type: application/json' --data '{ + "text": "Pytest Report:\n```'${{ steps.pytest.outputs.pytest_report_content }}'```" + }' $SLACK_WEBHOOK_URL From 3c8038281ec6d86bea5b5b02fe359ae2f4118a9c Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 25 Sep 2023 16:58:44 -0700 Subject: [PATCH 02/48] Add scheduled tests. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 07a0476e..957efa8f 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -1,4 +1,4 @@ -name: Utilities Tests +name: Scheduled Tests # on: # push: {} From bf341873f1d4ae5120aa02be36a96be8817b74a8 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 25 Sep 2023 17:00:35 -0700 Subject: [PATCH 03/48] Add scheduled tests. --- .github/workflows/scheduled_tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 957efa8f..fe2293cf 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -1,10 +1,10 @@ name: Scheduled Tests -# on: -# push: {} -# pull_request: -# branches: -# - master +on: + push: {} + pull_request: + branches: + - add-scheduled-tests on: workflow_dispatch jobs: From 919d189e6463fdde52fcd1afc5d970c6d45577c0 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 25 Sep 2023 17:01:18 -0700 Subject: [PATCH 04/48] Add scheduled tests. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index fe2293cf..67bb3d57 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -5,7 +5,7 @@ on: pull_request: branches: - add-scheduled-tests -on: workflow_dispatch +# on: workflow_dispatch jobs: run_app_tests: From c345d15260b20bfd4914daea1c1449ca633b8364 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 25 Sep 2023 17:03:09 -0700 Subject: [PATCH 05/48] Add scheduled tests. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 67bb3d57..92eba0a0 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -35,7 +35,7 @@ jobs: - name: Run Pytest and Capture Report id: pytest run: | - pytest src/tests/test_remote.py --html=pytest_report.html + pytest src/tests/test_remote.py --junitxml=pytest_report.xml pytest_report_content=$(cat pytest_report.html) env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 480efb1680946059e6230984a4ef0d076f127039 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 25 Sep 2023 17:04:56 -0700 Subject: [PATCH 06/48] Add scheduled tests. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 92eba0a0..c51fde21 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -36,7 +36,7 @@ jobs: id: pytest run: | pytest src/tests/test_remote.py --junitxml=pytest_report.xml - pytest_report_content=$(cat pytest_report.html) + pytest_report_content=$(cat pytest_report.xml) env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 93146448c3f9533e51fe645a644cf8405bd7696a Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 25 Sep 2023 17:06:18 -0700 Subject: [PATCH 07/48] Add scheduled tests. --- .github/workflows/scheduled_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index c51fde21..6921beec 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -37,11 +37,11 @@ jobs: run: | pytest src/tests/test_remote.py --junitxml=pytest_report.xml pytest_report_content=$(cat pytest_report.xml) - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - name: Send Report to Slack run: | curl -X POST -H 'Content-type: application/json' --data '{ "text": "Pytest Report:\n```'${{ steps.pytest.outputs.pytest_report_content }}'```" }' $SLACK_WEBHOOK_URL + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 36ffab160f1f5c88854161b2b7736c4fddcdf163 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 14:46:43 -0700 Subject: [PATCH 08/48] Get pytest report content. --- .github/workflows/scheduled_tests.yml | 37 ++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 6921beec..143688b5 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -13,8 +13,21 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] + # python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.11" ] steps: + - name: Get Metadata Version + id: metadataVersion + uses: fjogeleit/http-request-action@v1 + with: + url: "https://mygeneset.info/metadata" + + - name: Show Response + run: | + echo ${{ steps.metadataVersion.outputs.response }} + echo ${{ steps.metadataVersion.outputs.headers }} + echo ${{ fromJson(steps.metadataVersion.outputs.response).build_date }} + - name: Checkout source uses: actions/checkout@v3 @@ -36,12 +49,30 @@ jobs: id: pytest run: | pytest src/tests/test_remote.py --junitxml=pytest_report.xml - pytest_report_content=$(cat pytest_report.xml) + + - name: Read Pytest Report File Content + id: read-pytest-report + run: | + # Use the cat command to read the file and store its content in a variable + pytest_report_content=$(cat pytest_report.xml) + echo "::set-output name=content::$pytest_report_content" - name: Send Report to Slack run: | curl -X POST -H 'Content-type: application/json' --data '{ - "text": "Pytest Report:\n```'${{ steps.pytest.outputs.pytest_report_content }}'```" + "text": "Pytest Report:\n```'${{ steps.read-pytest-report.outputs.pytest_report_content }}'```" }' $SLACK_WEBHOOK_URL env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + - name: Send Report to Slack + uses: rtCamp/action-slack@v4 + with: + status: 'File Content' + text: ${{ steps.read-pytest-report.outputs.content }} + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + + - name: Setup tmate debug session on failure + if: ${{ failure() }} + uses: mxschmitt/action-tmate@v3 From 2c33f92c3c20bef82ad06a317b28e3e67d18b1f1 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 14:51:12 -0700 Subject: [PATCH 09/48] Get pytest report content. --- .github/workflows/scheduled_tests.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 143688b5..0b703afa 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -65,14 +65,6 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - name: Send Report to Slack - uses: rtCamp/action-slack@v4 - with: - status: 'File Content' - text: ${{ steps.read-pytest-report.outputs.content }} - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} - - name: Setup tmate debug session on failure if: ${{ failure() }} uses: mxschmitt/action-tmate@v3 From 0e3429c61a5946720b84490b6a8ada1f645ebbf7 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 14:53:52 -0700 Subject: [PATCH 10/48] Use HTTP GET method to get metadata version. --- .github/workflows/scheduled_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 0b703afa..09a7649a 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -21,6 +21,7 @@ jobs: uses: fjogeleit/http-request-action@v1 with: url: "https://mygeneset.info/metadata" + method: 'GET' - name: Show Response run: | From a8bb7d707a1055c04d9d4040378fff086e9f3f48 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 14:58:36 -0700 Subject: [PATCH 11/48] Force run tests. From 8a6f3e90c0f7b49293cd0bd3980c038bb6be0f4f Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 16:05:19 -0700 Subject: [PATCH 12/48] Use HTTP GET method to get metadata version. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 09a7649a..3bcacac9 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -21,7 +21,7 @@ jobs: uses: fjogeleit/http-request-action@v1 with: url: "https://mygeneset.info/metadata" - method: 'GET' + method: "GET" - name: Show Response run: | From 898640994cb9b36a4f839c6de2437f90e30b3740 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 16:20:09 -0700 Subject: [PATCH 13/48] Use HTTP GET method to get metadata version. --- .github/workflows/scheduled_tests.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 3bcacac9..4650b200 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -18,16 +18,19 @@ jobs: steps: - name: Get Metadata Version id: metadataVersion - uses: fjogeleit/http-request-action@v1 + uses: satak/webrequest-action@master with: - url: "https://mygeneset.info/metadata" - method: "GET" + url: https://mygeneset.info/metadata + method: GET - name: Show Response + # run: | + # echo ${{ steps.metadataVersion.outputs.response }} + # echo ${{ steps.metadataVersion.outputs.headers }} + # echo ${{ fromJson(steps.metadataVersion.outputs.response).build_date }} run: | - echo ${{ steps.metadataVersion.outputs.response }} - echo ${{ steps.metadataVersion.outputs.headers }} - echo ${{ fromJson(steps.metadataVersion.outputs.response).build_date }} + $output = '${{ steps.metadataVersion.outputs.output }}' | ConvertFrom-Json + Write-Host "Time from output $($output.time) statusCode $($output.statusCode) data $($output.data)" - name: Checkout source uses: actions/checkout@v3 From dc4ff5d2a153d44555ad97509bfd1d382db0f198 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 16:25:03 -0700 Subject: [PATCH 14/48] Use HTTP GET method to get metadata version. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 4650b200..1cbdc456 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -29,7 +29,7 @@ jobs: # echo ${{ steps.metadataVersion.outputs.headers }} # echo ${{ fromJson(steps.metadataVersion.outputs.response).build_date }} run: | - $output = '${{ steps.metadataVersion.outputs.output }}' | ConvertFrom-Json + $output = '${{ steps.metadataVersion.outputs.output }}' Write-Host "Time from output $($output.time) statusCode $($output.statusCode) data $($output.data)" - name: Checkout source From eb0373ac6163faab414466d0aa9cd6cb4d0faea7 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 16:26:06 -0700 Subject: [PATCH 15/48] Use HTTP GET method to get metadata version. --- .github/workflows/scheduled_tests.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 1cbdc456..119fc7f8 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -24,10 +24,6 @@ jobs: method: GET - name: Show Response - # run: | - # echo ${{ steps.metadataVersion.outputs.response }} - # echo ${{ steps.metadataVersion.outputs.headers }} - # echo ${{ fromJson(steps.metadataVersion.outputs.response).build_date }} run: | $output = '${{ steps.metadataVersion.outputs.output }}' Write-Host "Time from output $($output.time) statusCode $($output.statusCode) data $($output.data)" From fba589b86df7f2a35532175c6a3887ffa094d0a2 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 16:35:30 -0700 Subject: [PATCH 16/48] Use HTTP GET method to get metadata version. --- .github/workflows/scheduled_tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 119fc7f8..da855a84 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -25,8 +25,7 @@ jobs: - name: Show Response run: | - $output = '${{ steps.metadataVersion.outputs.output }}' - Write-Host "Time from output $($output.time) statusCode $($output.statusCode) data $($output.data)" + echo ${{ steps.metadataVersion.outputs.output }} - name: Checkout source uses: actions/checkout@v3 From c6ddafe1c9952e5acb5000c36d379d6b70ce1e93 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 16:38:44 -0700 Subject: [PATCH 17/48] Use HTTP GET method to get metadata version. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index da855a84..fbab4c40 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -25,7 +25,7 @@ jobs: - name: Show Response run: | - echo ${{ steps.metadataVersion.outputs.output }} + echo ${{ steps.metadataVersion.outputs.output.data.build_date }} - name: Checkout source uses: actions/checkout@v3 From d545e96765723bcde3ee7672055abe8660291dd6 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 16:43:01 -0700 Subject: [PATCH 18/48] Get metadata version. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index fbab4c40..dc933490 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -25,7 +25,7 @@ jobs: - name: Show Response run: | - echo ${{ steps.metadataVersion.outputs.output.data.build_date }} + echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" - name: Checkout source uses: actions/checkout@v3 From 96576c4c5e6ad983cbbb2a346fb18d4cf676cce4 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 16:56:56 -0700 Subject: [PATCH 19/48] Get pytest resport. --- .github/workflows/scheduled_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index dc933490..d5acca57 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -53,13 +53,13 @@ jobs: id: read-pytest-report run: | # Use the cat command to read the file and store its content in a variable - pytest_report_content=$(cat pytest_report.xml) + pytest_report_content=$(cat pytest_report.xml) echo "::set-output name=content::$pytest_report_content" - name: Send Report to Slack run: | curl -X POST -H 'Content-type: application/json' --data '{ - "text": "Pytest Report:\n```'${{ steps.read-pytest-report.outputs.pytest_report_content }}'```" + "text": "Pytest Report:\n```'${{ steps.read-pytest-report.outputs }}'```" }' $SLACK_WEBHOOK_URL env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 65aa8ce4e9d21376420a74488bb8358b5e941329 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 17:01:47 -0700 Subject: [PATCH 20/48] Get pytest resport. --- .github/workflows/scheduled_tests.yml | 50 +++++++++++++++++++-------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index d5acca57..9ad4ff51 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -44,23 +44,43 @@ jobs: - name: Install PyTest run: pip install pytest - - name: Run Pytest and Capture Report - id: pytest - run: | - pytest src/tests/test_remote.py --junitxml=pytest_report.xml + # - name: Run Pytest and Capture Report + # id: pytest + # run: | + # pytest src/tests/test_remote.py --junitxml=pytest_report.xml - - name: Read Pytest Report File Content - id: read-pytest-report - run: | - # Use the cat command to read the file and store its content in a variable - pytest_report_content=$(cat pytest_report.xml) - echo "::set-output name=content::$pytest_report_content" + # - name: Read Pytest Report File Content + # id: read-pytest-report + # run: | + # # Use the cat command to read the file and store its content in a variable + # pytest_report_content=$(cat pytest_report.xml) + # echo "::set-output name=content::$pytest_report_content" - - name: Send Report to Slack - run: | - curl -X POST -H 'Content-type: application/json' --data '{ - "text": "Pytest Report:\n```'${{ steps.read-pytest-report.outputs }}'```" - }' $SLACK_WEBHOOK_URL + # - name: Send Report to Slack + # run: | + # curl -X POST -H 'Content-type: application/json' --data '{ + # "text": "Pytest Report:\n```'${{ steps.read-pytest-report.outputs.pytest_report_content }}'```" + # }' $SLACK_WEBHOOK_URL + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + + - name: Run pytest and generate report + run: pytest src/tests/test_remote.py --junitxml=pytest-report.xml + + - name: Upload report to GitHub Artifacts + uses: actions/upload-artifact@v2 + with: + name: pytest-report + path: pytest-report.xml + + - name: Send report to Slack + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + author_name: GitHub Actions + title: Pytest Report + fields: name,status env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 286218a8763c4d0577978847928e5e5862790f69 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 17:13:24 -0700 Subject: [PATCH 21/48] Get pytest resport. --- .github/workflows/scheduled_tests.yml | 33 ++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 9ad4ff51..58b6caaa 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -74,13 +74,44 @@ jobs: name: pytest-report path: pytest-report.xml + - name: Extract test counts + run: | + failed=$(xmlstarlet sel -t -v "count(//testcase[failure])" pytest-report.xml) + succeeded=$(xmlstarlet sel -t -v "count(//testcase[not(failure)])" pytest-report.xml) + errored=$(xmlstarlet sel -t -v "count(//testcase[error])" pytest-report.xml) + skipped=$(xmlstarlet sel -t -v "count(//testcase[skipped])" pytest-report.xml) + unknown=$(xmlstarlet sel -t -v "count(//testcase[not(failure) and not(error) and not(skipped)])" pytest-report.xml) + echo "FAILED=${failed}" >> $GITHUB_ENV + echo "SUCCEEDED=${succeeded}" >> $GITHUB_ENV + echo "ERRORED=${errored}" >> $GITHUB_ENV + echo "SKIPPED=${skipped}" >> $GITHUB_ENV + echo "UNKNOWN=${unknown}" >> $GITHUB_ENV + continue-on-error: true # Continue even if the pytest report does not exist + + # - name: Send report to Slack + # uses: 8398a7/action-slack@v3 + # with: + # status: ${{ job.status }} + # author_name: GitHub Actions + # title: Pytest Report + # fields: name,status + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + - name: Send report to Slack uses: 8398a7/action-slack@v3 with: status: ${{ job.status }} author_name: GitHub Actions title: Pytest Report - fields: name,status + fields: | + Name: ${{ github.workflow }} + Status: ${{ job.status }} + Failed: ${{ env.FAILED }} + Succeeded: ${{ env.SUCCEEDED }} + Errored: ${{ env.ERRORED }} + Skipped: ${{ env.SKIPPED }} + Unknown: ${{ env.UNKNOWN }} env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 15799d669f70282943707b1d141a0f56b6ab4d97 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Fri, 6 Oct 2023 17:15:16 -0700 Subject: [PATCH 22/48] Get pytest resport. --- .github/workflows/scheduled_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 58b6caaa..43cf2101 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -74,6 +74,8 @@ jobs: name: pytest-report path: pytest-report.xml + - name: Install xmlstarlet + run: sudo apt-get update && sudo apt-get install -y xmlstarlet - name: Extract test counts run: | failed=$(xmlstarlet sel -t -v "count(//testcase[failure])" pytest-report.xml) From eccc7cc05209250e30d7aeb18dfe84c26c456ea4 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 10:05:04 -0700 Subject: [PATCH 23/48] Get pytest report info. --- .github/workflows/scheduled_tests.yml | 50 ++++++++++++++------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 43cf2101..0d1d667f 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -66,7 +66,7 @@ jobs: - name: Run pytest and generate report - run: pytest src/tests/test_remote.py --junitxml=pytest-report.xml + run: pytest src/tests/test_remote.py --junitxml=pytest_report.xml - name: Upload report to GitHub Artifacts uses: actions/upload-artifact@v2 @@ -77,17 +77,21 @@ jobs: - name: Install xmlstarlet run: sudo apt-get update && sudo apt-get install -y xmlstarlet - name: Extract test counts + id: pytest run: | - failed=$(xmlstarlet sel -t -v "count(//testcase[failure])" pytest-report.xml) - succeeded=$(xmlstarlet sel -t -v "count(//testcase[not(failure)])" pytest-report.xml) - errored=$(xmlstarlet sel -t -v "count(//testcase[error])" pytest-report.xml) - skipped=$(xmlstarlet sel -t -v "count(//testcase[skipped])" pytest-report.xml) - unknown=$(xmlstarlet sel -t -v "count(//testcase[not(failure) and not(error) and not(skipped)])" pytest-report.xml) - echo "FAILED=${failed}" >> $GITHUB_ENV - echo "SUCCEEDED=${succeeded}" >> $GITHUB_ENV - echo "ERRORED=${errored}" >> $GITHUB_ENV - echo "SKIPPED=${skipped}" >> $GITHUB_ENV - echo "UNKNOWN=${unknown}" >> $GITHUB_ENV + # Parse pytest report and extract desired fields + errors=$(grep -o 'errors="[^"]*"' pytest_report.xml | cut -d'"' -f2) + failures=$(grep -o 'failures="[^"]*"' pytest_report.xml | cut -d'"' -f2) + skipped=$(grep -o 'skipped="[^"]*"' pytest_report.xml | cut -d'"' -f2) + tests=$(grep -o 'tests="[^"]*"' pytest_report.xml | cut -d'"' -f2) + time=$(grep -o 'time="[^"]*"' pytest_report.xml | cut -d'"' -f2) + + echo "Errors: $errors" + echo "Failures: $failures" + echo "Skipped: $skipped" + echo "Tests: $tests" + echo "Time: $time" + working-directory: ${{ github.workspace }} continue-on-error: true # Continue even if the pytest report does not exist # - name: Send report to Slack @@ -100,20 +104,18 @@ jobs: # env: # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - name: Send report to Slack - uses: 8398a7/action-slack@v3 + - name: Send to Slack + uses: Ilshidur/action-slack@v4 with: - status: ${{ job.status }} - author_name: GitHub Actions - title: Pytest Report - fields: | - Name: ${{ github.workflow }} - Status: ${{ job.status }} - Failed: ${{ env.FAILED }} - Succeeded: ${{ env.SUCCEEDED }} - Errored: ${{ env.ERRORED }} - Skipped: ${{ env.SKIPPED }} - Unknown: ${{ env.UNKNOWN }} + status: 'success' # You can customize this based on your needs + message: | + Pytest Report: + - Errors: ${{ steps.pytest.outputs.errors }} + - Failures: ${{ steps.pytest.outputs.failures }} + - Skipped: ${{ steps.pytest.outputs.skipped }} + - Tests: ${{ steps.pytest.outputs.tests }} + - Time: ${{ steps.pytest.outputs.time }} + # channel: '#your-slack-channel' # Replace with your Slack channel env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 7bd8d9f713fb51ad007c2d68f91aacee58eb09eb Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 10:08:18 -0700 Subject: [PATCH 24/48] Get pytest report info. --- .github/workflows/scheduled_tests.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 0d1d667f..d679166d 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -74,8 +74,6 @@ jobs: name: pytest-report path: pytest-report.xml - - name: Install xmlstarlet - run: sudo apt-get update && sudo apt-get install -y xmlstarlet - name: Extract test counts id: pytest run: | @@ -104,21 +102,22 @@ jobs: # env: # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - name: Send to Slack - uses: Ilshidur/action-slack@v4 + - name: Send report to Slack + uses: 8398a7/action-slack@v3 with: - status: 'success' # You can customize this based on your needs - message: | + status: ${{ job.status }} + author_name: Mygeneset Scheduled Pytest + # title: Pytest Report + fields: | Pytest Report: - Errors: ${{ steps.pytest.outputs.errors }} - Failures: ${{ steps.pytest.outputs.failures }} - Skipped: ${{ steps.pytest.outputs.skipped }} - Tests: ${{ steps.pytest.outputs.tests }} - Time: ${{ steps.pytest.outputs.time }} - # channel: '#your-slack-channel' # Replace with your Slack channel env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - name: Setup tmate debug session on failure - if: ${{ failure() }} - uses: mxschmitt/action-tmate@v3 + # - name: Setup tmate debug session on failure + # if: ${{ failure() }} + # uses: mxschmitt/action-tmate@v3 From 8e3e10ce76372cb74e74d61231e20340636265b0 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 10:23:18 -0700 Subject: [PATCH 25/48] Get pytest report info. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index d679166d..7cc83740 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -108,7 +108,7 @@ jobs: status: ${{ job.status }} author_name: Mygeneset Scheduled Pytest # title: Pytest Report - fields: | + message: | Pytest Report: - Errors: ${{ steps.pytest.outputs.errors }} - Failures: ${{ steps.pytest.outputs.failures }} From 0852b48614fb4c862f8d931e4742605b64fe7a66 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 11:45:38 -0700 Subject: [PATCH 26/48] Get pytest report info. --- .github/workflows/scheduled_tests.yml | 106 ++++++++++++++++---------- 1 file changed, 66 insertions(+), 40 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 7cc83740..7fc60494 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -41,9 +41,12 @@ jobs: - name: Install dependencies run: pip install -r requirements_web.txt - - name: Install PyTest + - name: Install pytest run: pip install pytest + - name: Install pytest-slack + run: pip install pytest-slack + # - name: Run Pytest and Capture Report # id: pytest # run: | @@ -64,33 +67,37 @@ jobs: # env: # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - name: Run pytest and generate report - run: pytest src/tests/test_remote.py --junitxml=pytest_report.xml + run: pytest src/tests/test_remote.py --slack_hook=${{ secrets.SLACK_WEBHOOK_URL }} --slack_channel=observability-test + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - name: Upload report to GitHub Artifacts - uses: actions/upload-artifact@v2 - with: - name: pytest-report - path: pytest-report.xml + # - name: Run pytest and generate report + # run: pytest src/tests/test_remote.py --junitxml=pytest_report.xml - - name: Extract test counts - id: pytest - run: | - # Parse pytest report and extract desired fields - errors=$(grep -o 'errors="[^"]*"' pytest_report.xml | cut -d'"' -f2) - failures=$(grep -o 'failures="[^"]*"' pytest_report.xml | cut -d'"' -f2) - skipped=$(grep -o 'skipped="[^"]*"' pytest_report.xml | cut -d'"' -f2) - tests=$(grep -o 'tests="[^"]*"' pytest_report.xml | cut -d'"' -f2) - time=$(grep -o 'time="[^"]*"' pytest_report.xml | cut -d'"' -f2) - - echo "Errors: $errors" - echo "Failures: $failures" - echo "Skipped: $skipped" - echo "Tests: $tests" - echo "Time: $time" - working-directory: ${{ github.workspace }} - continue-on-error: true # Continue even if the pytest report does not exist + # - name: Upload report to GitHub Artifacts + # uses: actions/upload-artifact@v2 + # with: + # name: pytest-report + # path: pytest-report.xml + + # - name: Extract test counts + # id: pytest + # run: | + # # Parse pytest report and extract desired fields + # errors=$(grep -o 'errors="[^"]*"' pytest_report.xml | cut -d'"' -f2) + # failures=$(grep -o 'failures="[^"]*"' pytest_report.xml | cut -d'"' -f2) + # skipped=$(grep -o 'skipped="[^"]*"' pytest_report.xml | cut -d'"' -f2) + # tests=$(grep -o 'tests="[^"]*"' pytest_report.xml | cut -d'"' -f2) + # time=$(grep -o 'time="[^"]*"' pytest_report.xml | cut -d'"' -f2) + + # echo "Errors: $errors" + # echo "Failures: $failures" + # echo "Skipped: $skipped" + # echo "Tests: $tests" + # echo "Time: $time" + # working-directory: ${{ github.workspace }} + # continue-on-error: true # Continue even if the pytest report does not exist # - name: Send report to Slack # uses: 8398a7/action-slack@v3 @@ -102,21 +109,40 @@ jobs: # env: # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - name: Send report to Slack - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - author_name: Mygeneset Scheduled Pytest - # title: Pytest Report - message: | - Pytest Report: - - Errors: ${{ steps.pytest.outputs.errors }} - - Failures: ${{ steps.pytest.outputs.failures }} - - Skipped: ${{ steps.pytest.outputs.skipped }} - - Tests: ${{ steps.pytest.outputs.tests }} - - Time: ${{ steps.pytest.outputs.time }} - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + # - name: Send Pytest Report to Slack + # id: slack + # uses: slackapi/slack-github-action@v1.24.0 + # with: + # # This data can be any valid JSON from a previous step in the GitHub Action + # payload: | + # { + # "blocks": "", + # "attachments": { + # "text": "Passed Count: *{SlackTemplate.RESULTS['passed']}*", + # "mrkdwn_in": [ + # "text" + # ], + # "color": "good" + # }, + # } + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + # - name: Send report to Slack + # uses: 8398a7/action-slack@v3 + # with: + # status: ${{ job.status }} + # author_name: Mygeneset Scheduled Pytest + # # title: Pytest Report + # message: | + # Pytest Report: + # - Errors: ${{ steps.pytest.outputs.errors }} + # - Failures: ${{ steps.pytest.outputs.failures }} + # - Skipped: ${{ steps.pytest.outputs.skipped }} + # - Tests: ${{ steps.pytest.outputs.tests }} + # - Time: ${{ steps.pytest.outputs.time }} + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # - name: Setup tmate debug session on failure # if: ${{ failure() }} From 6f9f119447b18f673c3b70d7caf6977253f73d3b Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 12:17:00 -0700 Subject: [PATCH 27/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 30 +++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 7fc60494..03d00bba 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -16,17 +16,43 @@ jobs: # python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] python-version: [ "3.11" ] steps: - - name: Get Metadata Version + - name: Get metadata version id: metadataVersion uses: satak/webrequest-action@master with: url: https://mygeneset.info/metadata method: GET - - name: Show Response + - name: Show metadata response run: | echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" + ######## + + - name: Create metadata artifact + run: | + echo "mygeneset_metadata_version" > mygeneset_metadata_version.txt + echo "::set-output name=artifact_path::mygeneset_metadata_version.txt" + id: create-artifact + + - name: Upload metadata artifact + uses: actions/upload-artifact@v2 + with: + name: mygeneset-metadata-version + path: ${{ steps.create-artifact.outputs.artifact_path }} + + - name: Download Artifact + uses: actions/download-artifact@v2 + with: + name: mygeneset-metadata-version + + - name: Read Artifact + run: | + cat mygeneset-metadata-version/mygeneset_metadata_version.txt + # The value 'my_value' will be printed + + ######### + - name: Checkout source uses: actions/checkout@v3 From 15cbb9ec19509e0682848f61fa7dac9dfe64ee15 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 12:29:07 -0700 Subject: [PATCH 28/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 03d00bba..ae67b41c 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -31,24 +31,23 @@ jobs: - name: Create metadata artifact run: | - echo "mygeneset_metadata_version" > mygeneset_metadata_version.txt - echo "::set-output name=artifact_path::mygeneset_metadata_version.txt" + echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" > mygeneset_metadata_version.txt id: create-artifact - name: Upload metadata artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: mygeneset-metadata-version - path: ${{ steps.create-artifact.outputs.artifact_path }} + path: mygeneset_metadata_version.txt - name: Download Artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: mygeneset-metadata-version - name: Read Artifact run: | - cat mygeneset-metadata-version/mygeneset_metadata_version.txt + cat mygeneset_metadata_version.txt # The value 'my_value' will be printed ######### From 241f3f7c44643a5f90abbd0fa1350811a1c1e906 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 12:39:28 -0700 Subject: [PATCH 29/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 38 ++++++++++++++++++++------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index ae67b41c..6048a1c8 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -29,6 +29,34 @@ jobs: ######## + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: mygeneset-metadata-version + + - name: Read Artifact + run: | + cat mygeneset_metadata_version.txt + + - name: Compare metadata versions + id: compare + run: | + version_new=${{fromJson(steps.metadataVersion.outputs.output).data.build_date}} + version_old=$(cat mygeneset_metadata_version.txt) + + echo "version_new" + echo version_new + echo "version_old" + echo version_old + + if [ "$version_new" = "$version_old" ]; then + echo "No new version identified. Stopping workflow." + echo "::error::Values are the same." + exit 1 + else + echo "New version identified. Proceeding with the workflow." + fi + - name: Create metadata artifact run: | echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" > mygeneset_metadata_version.txt @@ -40,16 +68,6 @@ jobs: name: mygeneset-metadata-version path: mygeneset_metadata_version.txt - - name: Download Artifact - uses: actions/download-artifact@v3 - with: - name: mygeneset-metadata-version - - - name: Read Artifact - run: | - cat mygeneset_metadata_version.txt - # The value 'my_value' will be printed - ######### - name: Checkout source From a40db23305631ec33b3536507f09b02a5b5e930b Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 12:41:45 -0700 Subject: [PATCH 30/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 6048a1c8..5de3cc11 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -33,6 +33,7 @@ jobs: uses: actions/download-artifact@v3 with: name: mygeneset-metadata-version + path: mygeneset_metadata_version.txt - name: Read Artifact run: | From ce425934cf75f1431c31d474625445b31f0a29c2 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 12:48:22 -0700 Subject: [PATCH 31/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 5de3cc11..0d4bfe50 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -29,6 +29,19 @@ jobs: ######## + - name: Create metadata artifact + run: | + echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" > mygeneset_metadata_version.txt + id: create-artifact + + - name: Upload metadata artifact + uses: actions/upload-artifact@v3 + with: + name: mygeneset-metadata-version + path: mygeneset_metadata_version.txt + + ### --- ### + - name: Download Artifact uses: actions/download-artifact@v3 with: From 5e094a32567194cef39e85e86b96c1bb4c5e3b3c Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 12:49:41 -0700 Subject: [PATCH 32/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 0d4bfe50..a7a0d5fc 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -32,7 +32,6 @@ jobs: - name: Create metadata artifact run: | echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" > mygeneset_metadata_version.txt - id: create-artifact - name: Upload metadata artifact uses: actions/upload-artifact@v3 From fed4149911adf49dd8cbdfe1782da5f6e6d91fb2 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 12:53:25 -0700 Subject: [PATCH 33/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index a7a0d5fc..80c02b3c 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -39,6 +39,11 @@ jobs: name: mygeneset-metadata-version path: mygeneset_metadata_version.txt + - name: Remove local metadata artifact + run: | + rm -r mygeneset_metadata_version.txt + + ### --- ### - name: Download Artifact From e082ccbaf118922ff0b57532377935bb9a97f6da Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 12:56:20 -0700 Subject: [PATCH 34/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 80c02b3c..16f9dbc5 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -50,7 +50,7 @@ jobs: uses: actions/download-artifact@v3 with: name: mygeneset-metadata-version - path: mygeneset_metadata_version.txt + # path: mygeneset_metadata_version.txt - name: Read Artifact run: | From 1ba1b79206e0408332695281923fa3b6361ddd94 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 12:57:22 -0700 Subject: [PATCH 35/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 16f9dbc5..9919cbe3 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -63,9 +63,9 @@ jobs: version_old=$(cat mygeneset_metadata_version.txt) echo "version_new" - echo version_new + echo $version_new echo "version_old" - echo version_old + echo $version_old if [ "$version_new" = "$version_old" ]; then echo "No new version identified. Stopping workflow." From 2fed3caaa92bdc7a6efb46703c0498f8ecca120c Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 13:07:19 -0700 Subject: [PATCH 36/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 9919cbe3..655f06ca 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -29,19 +29,19 @@ jobs: ######## - - name: Create metadata artifact - run: | - echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" > mygeneset_metadata_version.txt + # - name: Create metadata artifact + # run: | + # echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" > mygeneset_metadata_version.txt - - name: Upload metadata artifact - uses: actions/upload-artifact@v3 - with: - name: mygeneset-metadata-version - path: mygeneset_metadata_version.txt + # - name: Upload metadata artifact + # uses: actions/upload-artifact@v3 + # with: + # name: mygeneset-metadata-version + # path: mygeneset_metadata_version.txt - - name: Remove local metadata artifact - run: | - rm -r mygeneset_metadata_version.txt + # - name: Remove local metadata artifact + # run: | + # rm -r mygeneset_metadata_version.txt ### --- ### @@ -70,7 +70,7 @@ jobs: if [ "$version_new" = "$version_old" ]; then echo "No new version identified. Stopping workflow." echo "::error::Values are the same." - exit 1 + exit 0 else echo "New version identified. Proceeding with the workflow." fi From c1cd56bb003abee95a408c51fd7b705c8c8a8c5a Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 15:16:03 -0700 Subject: [PATCH 37/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 67 +++++++++++---------------- 1 file changed, 28 insertions(+), 39 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 655f06ca..07b7df6d 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -5,8 +5,13 @@ on: pull_request: branches: - add-scheduled-tests + # on: workflow_dispatch +# on: +# schedule: +# - cron: '58 */3 * * *' + jobs: run_app_tests: runs-on: ubuntu-latest @@ -16,7 +21,7 @@ jobs: # python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] python-version: [ "3.11" ] steps: - - name: Get metadata version + - name: Get metadata version from API id: metadataVersion uses: satak/webrequest-action@master with: @@ -29,45 +34,28 @@ jobs: ######## - # - name: Create metadata artifact - # run: | - # echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" > mygeneset_metadata_version.txt - - # - name: Upload metadata artifact - # uses: actions/upload-artifact@v3 - # with: - # name: mygeneset-metadata-version - # path: mygeneset_metadata_version.txt - - # - name: Remove local metadata artifact - # run: | - # rm -r mygeneset_metadata_version.txt - - - ### --- ### - - - name: Download Artifact - uses: actions/download-artifact@v3 + - name: Restore metadata version variable from Cache + uses: actions/cache@v3 with: - name: mygeneset-metadata-version - # path: mygeneset_metadata_version.txt + path: ${{ github.workspace }}/.cache/mygeneset-metadata-version + key: ${{ runner.os }}-mygeneset-metadata-version - - name: Read Artifact + - name: Print metadata version variable Value run: | - cat mygeneset_metadata_version.txt + echo "${{ env.MYGENESET_METADATA_VERSION }}" - name: Compare metadata versions id: compare run: | - version_new=${{fromJson(steps.metadataVersion.outputs.output).data.build_date}} - version_old=$(cat mygeneset_metadata_version.txt) + version_from_api=${{ fromJson(steps.metadataVersion.outputs.output).data.build_date }} + version_from_cache=${{ env.MYGENESET_METADATA_VERSION }} - echo "version_new" - echo $version_new - echo "version_old" - echo $version_old + echo "version_from_api" + echo $version_from_api + echo "version_from_cache" + echo $version_from_cache - if [ "$version_new" = "$version_old" ]; then + if [ "$version_from_api" = "$version_from_cache" ]; then echo "No new version identified. Stopping workflow." echo "::error::Values are the same." exit 0 @@ -75,18 +63,19 @@ jobs: echo "New version identified. Proceeding with the workflow." fi - - name: Create metadata artifact + - name: Set metadata version variable run: | - echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" > mygeneset_metadata_version.txt - id: create-artifact + echo "MYGENESET_METADATA_VERSION=${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" >> $GITHUB_ENV - - name: Upload metadata artifact - uses: actions/upload-artifact@v3 + - name: Store metadata version variable in Cache + uses: actions/cache@v3 with: - name: mygeneset-metadata-version - path: mygeneset_metadata_version.txt + path: ${{ github.workspace }}/.cache/mygeneset-metadata-version + key: ${{ runner.os }}-mygeneset-metadata-version + restore-keys: | + - ${{ runner.os }}-mygeneset-metadata-version - ######### + ############## - name: Checkout source uses: actions/checkout@v3 From 22a547dcafd35312add3b0cbf9b7eba7da86642e Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 15:51:26 -0700 Subject: [PATCH 38/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 116 +++----------------------- 1 file changed, 13 insertions(+), 103 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 07b7df6d..9faacdc5 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -28,7 +28,7 @@ jobs: url: https://mygeneset.info/metadata method: GET - - name: Show metadata response + - name: Show mygeneset metadata version from API run: | echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" @@ -37,10 +37,12 @@ jobs: - name: Restore metadata version variable from Cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/.cache/mygeneset-metadata-version - key: ${{ runner.os }}-mygeneset-metadata-version + # path: ${{ github.workspace }}/.cache/mygeneset-metadata-version + # key: ${{ runner.os }}-mygeneset-metadata-version + path: ${{ github.workspace }}/.cache + key: mygeneset-metadata-version - - name: Print metadata version variable Value + - name: Show mygeneset metadata version from Cache run: | echo "${{ env.MYGENESET_METADATA_VERSION }}" @@ -70,10 +72,14 @@ jobs: - name: Store metadata version variable in Cache uses: actions/cache@v3 with: - path: ${{ github.workspace }}/.cache/mygeneset-metadata-version - key: ${{ runner.os }}-mygeneset-metadata-version + # path: ${{ github.workspace }}/.cache/mygeneset-metadata-version + # key: ${{ runner.os }}-mygeneset-metadata-version + # restore-keys: | + # - ${{ runner.os }}-mygeneset-metadata-version + path: ${{ github.workspace }}/.cache + key: mygeneset-metadata-version restore-keys: | - - ${{ runner.os }}-mygeneset-metadata-version + - mygeneset-metadata-version ############## @@ -97,103 +103,7 @@ jobs: - name: Install pytest-slack run: pip install pytest-slack - # - name: Run Pytest and Capture Report - # id: pytest - # run: | - # pytest src/tests/test_remote.py --junitxml=pytest_report.xml - - # - name: Read Pytest Report File Content - # id: read-pytest-report - # run: | - # # Use the cat command to read the file and store its content in a variable - # pytest_report_content=$(cat pytest_report.xml) - # echo "::set-output name=content::$pytest_report_content" - - # - name: Send Report to Slack - # run: | - # curl -X POST -H 'Content-type: application/json' --data '{ - # "text": "Pytest Report:\n```'${{ steps.read-pytest-report.outputs.pytest_report_content }}'```" - # }' $SLACK_WEBHOOK_URL - # env: - # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - name: Run pytest and generate report run: pytest src/tests/test_remote.py --slack_hook=${{ secrets.SLACK_WEBHOOK_URL }} --slack_channel=observability-test env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - # - name: Run pytest and generate report - # run: pytest src/tests/test_remote.py --junitxml=pytest_report.xml - - # - name: Upload report to GitHub Artifacts - # uses: actions/upload-artifact@v2 - # with: - # name: pytest-report - # path: pytest-report.xml - - # - name: Extract test counts - # id: pytest - # run: | - # # Parse pytest report and extract desired fields - # errors=$(grep -o 'errors="[^"]*"' pytest_report.xml | cut -d'"' -f2) - # failures=$(grep -o 'failures="[^"]*"' pytest_report.xml | cut -d'"' -f2) - # skipped=$(grep -o 'skipped="[^"]*"' pytest_report.xml | cut -d'"' -f2) - # tests=$(grep -o 'tests="[^"]*"' pytest_report.xml | cut -d'"' -f2) - # time=$(grep -o 'time="[^"]*"' pytest_report.xml | cut -d'"' -f2) - - # echo "Errors: $errors" - # echo "Failures: $failures" - # echo "Skipped: $skipped" - # echo "Tests: $tests" - # echo "Time: $time" - # working-directory: ${{ github.workspace }} - # continue-on-error: true # Continue even if the pytest report does not exist - - # - name: Send report to Slack - # uses: 8398a7/action-slack@v3 - # with: - # status: ${{ job.status }} - # author_name: GitHub Actions - # title: Pytest Report - # fields: name,status - # env: - # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - # - name: Send Pytest Report to Slack - # id: slack - # uses: slackapi/slack-github-action@v1.24.0 - # with: - # # This data can be any valid JSON from a previous step in the GitHub Action - # payload: | - # { - # "blocks": "", - # "attachments": { - # "text": "Passed Count: *{SlackTemplate.RESULTS['passed']}*", - # "mrkdwn_in": [ - # "text" - # ], - # "color": "good" - # }, - # } - # env: - # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - # - name: Send report to Slack - # uses: 8398a7/action-slack@v3 - # with: - # status: ${{ job.status }} - # author_name: Mygeneset Scheduled Pytest - # # title: Pytest Report - # message: | - # Pytest Report: - # - Errors: ${{ steps.pytest.outputs.errors }} - # - Failures: ${{ steps.pytest.outputs.failures }} - # - Skipped: ${{ steps.pytest.outputs.skipped }} - # - Tests: ${{ steps.pytest.outputs.tests }} - # - Time: ${{ steps.pytest.outputs.time }} - # env: - # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - # - name: Setup tmate debug session on failure - # if: ${{ failure() }} - # uses: mxschmitt/action-tmate@v3 From ff4d7a24f329320dc7591eb89faccbdf1b3d8238 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 16:00:48 -0700 Subject: [PATCH 39/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 9faacdc5..38e974c6 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -39,12 +39,13 @@ jobs: with: # path: ${{ github.workspace }}/.cache/mygeneset-metadata-version # key: ${{ runner.os }}-mygeneset-metadata-version - path: ${{ github.workspace }}/.cache + path: ${{ github.workspace }}/.cache/ key: mygeneset-metadata-version - - name: Show mygeneset metadata version from Cache + - name: Load mygeneset metadata version from Cache run: | echo "${{ env.MYGENESET_METADATA_VERSION }}" + MYGENESET_METADATA_VERSION=$(cat ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache) - name: Compare metadata versions id: compare @@ -69,6 +70,10 @@ jobs: run: | echo "MYGENESET_METADATA_VERSION=${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" >> $GITHUB_ENV + - name: Create metadata version file in Cache folder + run: | + echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" >> ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache + - name: Store metadata version variable in Cache uses: actions/cache@v3 with: From 82b94f868d4feb1529e673ee9667ba9b1a227261 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 16:13:31 -0700 Subject: [PATCH 40/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 38e974c6..2e168dfd 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -44,8 +44,17 @@ jobs: - name: Load mygeneset metadata version from Cache run: | - echo "${{ env.MYGENESET_METADATA_VERSION }}" - MYGENESET_METADATA_VERSION=$(cat ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache) + file_path="${{ github.workspace }}/.cache/mygeneset-metadata-version.cache" + + # Check if the file exists + if [ -f "$file_path" ]; then + # Read the file and store its content in the restored_value variable + MYGENESET_METADATA_VERSION=$(cat "$file_path") + echo "Restored Value: $MYGENESET_METADATA_VERSION" + else + echo "File does not exist or cannot be read." + MYGENESET_METADATA_VERSION= + fi - name: Compare metadata versions id: compare @@ -83,8 +92,6 @@ jobs: # - ${{ runner.os }}-mygeneset-metadata-version path: ${{ github.workspace }}/.cache key: mygeneset-metadata-version - restore-keys: | - - mygeneset-metadata-version ############## From 6c6dcc829f81f112b083a318d4bca308389d67ee Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 16:41:04 -0700 Subject: [PATCH 41/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 2e168dfd..df281a9a 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -81,6 +81,7 @@ jobs: - name: Create metadata version file in Cache folder run: | + mkdir ${{ github.workspace }}/.cache/ echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" >> ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache - name: Store metadata version variable in Cache From 3725e6f38a6e28fb988e2fe469d8ec668486e08b Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 16:53:57 -0700 Subject: [PATCH 42/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index df281a9a..80063b47 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -83,6 +83,7 @@ jobs: run: | mkdir ${{ github.workspace }}/.cache/ echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" >> ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache + echo $(cat ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache) - name: Store metadata version variable in Cache uses: actions/cache@v3 From 0ed965de37f3d13c3517524a4273a1d25d480f39 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 16:56:34 -0700 Subject: [PATCH 43/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 80063b47..f9ca6276 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -39,7 +39,7 @@ jobs: with: # path: ${{ github.workspace }}/.cache/mygeneset-metadata-version # key: ${{ runner.os }}-mygeneset-metadata-version - path: ${{ github.workspace }}/.cache/ + path: ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache key: mygeneset-metadata-version - name: Load mygeneset metadata version from Cache @@ -92,7 +92,7 @@ jobs: # key: ${{ runner.os }}-mygeneset-metadata-version # restore-keys: | # - ${{ runner.os }}-mygeneset-metadata-version - path: ${{ github.workspace }}/.cache + path: ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache key: mygeneset-metadata-version ############## From 08f79443baf4a715dec3428b3dbb29d1cf910207 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 16:59:34 -0700 Subject: [PATCH 44/48] Store metadata version. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index f9ca6276..18c64fad 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -35,7 +35,7 @@ jobs: ######## - name: Restore metadata version variable from Cache - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: # path: ${{ github.workspace }}/.cache/mygeneset-metadata-version # key: ${{ runner.os }}-mygeneset-metadata-version From c7cff19e2df1f64d96d17187a6e085344f990ee3 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 17:23:54 -0700 Subject: [PATCH 45/48] Enable schedule trigger. --- .github/workflows/scheduled_tests.yml | 143 ++++++++++++-------------- 1 file changed, 67 insertions(+), 76 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 18c64fad..8f95733f 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -5,12 +5,9 @@ on: pull_request: branches: - add-scheduled-tests - # on: workflow_dispatch - -# on: -# schedule: -# - cron: '58 */3 * * *' + schedule: + - cron: '58 */3 * * *' jobs: run_app_tests: @@ -18,82 +15,76 @@ jobs: strategy: fail-fast: false matrix: - # python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] python-version: [ "3.11" ] steps: - - name: Get metadata version from API - id: metadataVersion - uses: satak/webrequest-action@master - with: - url: https://mygeneset.info/metadata - method: GET - - - name: Show mygeneset metadata version from API - run: | - echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" ######## - - name: Restore metadata version variable from Cache - uses: actions/cache/restore@v3 - with: - # path: ${{ github.workspace }}/.cache/mygeneset-metadata-version - # key: ${{ runner.os }}-mygeneset-metadata-version - path: ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache - key: mygeneset-metadata-version - - - name: Load mygeneset metadata version from Cache - run: | - file_path="${{ github.workspace }}/.cache/mygeneset-metadata-version.cache" - - # Check if the file exists - if [ -f "$file_path" ]; then - # Read the file and store its content in the restored_value variable - MYGENESET_METADATA_VERSION=$(cat "$file_path") - echo "Restored Value: $MYGENESET_METADATA_VERSION" - else - echo "File does not exist or cannot be read." - MYGENESET_METADATA_VERSION= - fi - - - name: Compare metadata versions - id: compare - run: | - version_from_api=${{ fromJson(steps.metadataVersion.outputs.output).data.build_date }} - version_from_cache=${{ env.MYGENESET_METADATA_VERSION }} - - echo "version_from_api" - echo $version_from_api - echo "version_from_cache" - echo $version_from_cache - - if [ "$version_from_api" = "$version_from_cache" ]; then - echo "No new version identified. Stopping workflow." - echo "::error::Values are the same." - exit 0 - else - echo "New version identified. Proceeding with the workflow." - fi - - - name: Set metadata version variable - run: | - echo "MYGENESET_METADATA_VERSION=${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" >> $GITHUB_ENV - - - name: Create metadata version file in Cache folder - run: | - mkdir ${{ github.workspace }}/.cache/ - echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" >> ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache - echo $(cat ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache) - - - name: Store metadata version variable in Cache - uses: actions/cache@v3 - with: - # path: ${{ github.workspace }}/.cache/mygeneset-metadata-version - # key: ${{ runner.os }}-mygeneset-metadata-version - # restore-keys: | - # - ${{ runner.os }}-mygeneset-metadata-version - path: ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache - key: mygeneset-metadata-version + # - name: Get metadata version from API + # id: metadataVersion + # uses: satak/webrequest-action@master + # with: + # url: https://mygeneset.info/metadata + # method: GET + + # - name: Show mygeneset metadata version from API + # run: | + # echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" + + # - name: Restore metadata version variable from Cache + # uses: actions/cache/restore@v3 + # with: + # path: ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache + # key: mygeneset-metadata-version + + # - name: Load mygeneset metadata version from Cache + # run: | + # file_path="${{ github.workspace }}/.cache/mygeneset-metadata-version.cache" + + # # Check if the file exists + # if [ -f "$file_path" ]; then + # # Read the file and store its content in the restored_value variable + # MYGENESET_METADATA_VERSION=$(cat "$file_path") + # echo "Restored Value: $MYGENESET_METADATA_VERSION" + # else + # echo "File does not exist or cannot be read." + # MYGENESET_METADATA_VERSION= + # fi + + # - name: Compare metadata versions + # id: compare + # run: | + # version_from_api=${{ fromJson(steps.metadataVersion.outputs.output).data.build_date }} + # version_from_cache=${{ env.MYGENESET_METADATA_VERSION }} + + # echo "version_from_api" + # echo $version_from_api + # echo "version_from_cache" + # echo $version_from_cache + + # if [ "$version_from_api" = "$version_from_cache" ]; then + # echo "No new version identified. Stopping workflow." + # echo "::error::Values are the same." + # exit 0 + # else + # echo "New version identified. Proceeding with the workflow." + # fi + + # - name: Set metadata version variable + # run: | + # echo "MYGENESET_METADATA_VERSION=${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" >> $GITHUB_ENV + + # - name: Create metadata version file in Cache folder + # run: | + # mkdir ${{ github.workspace }}/.cache/ + # echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" >> ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache + # echo $(cat ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache) + + # - name: Store metadata version variable in Cache + # uses: actions/cache@v3 + # with: + # path: ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache + # key: mygeneset-metadata-version ############## From cbb78b97f7a72abe4e1d834673451642c6673f85 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 17:25:19 -0700 Subject: [PATCH 46/48] Enable schedule trigger. --- .github/workflows/scheduled_tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 8f95733f..fbe75658 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -1,11 +1,6 @@ name: Scheduled Tests on: - push: {} - pull_request: - branches: - - add-scheduled-tests -# on: workflow_dispatch schedule: - cron: '58 */3 * * *' From 69ed61b5dc79082ede4adf5fdcd1792dba966a3e Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 17:25:59 -0700 Subject: [PATCH 47/48] Enable schedule trigger. --- .github/workflows/scheduled_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index fbe75658..2e8808ed 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -2,7 +2,7 @@ name: Scheduled Tests on: schedule: - - cron: '58 */3 * * *' + - cron: '30 * * * *' jobs: run_app_tests: From 821695227b80406b796e9d825166c09f92f31497 Mon Sep 17 00:00:00 2001 From: everaldorodrigo Date: Mon, 9 Oct 2023 17:36:43 -0700 Subject: [PATCH 48/48] Enable schedule trigger. --- .github/workflows/scheduled_tests.yml | 75 ++------------------------- 1 file changed, 3 insertions(+), 72 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index 2e8808ed..8f994a2c 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -2,87 +2,18 @@ name: Scheduled Tests on: schedule: - - cron: '30 * * * *' + - cron: '0 */3 * * *' jobs: run_app_tests: runs-on: ubuntu-latest + strategy: fail-fast: false matrix: python-version: [ "3.11" ] - steps: - - ######## - - # - name: Get metadata version from API - # id: metadataVersion - # uses: satak/webrequest-action@master - # with: - # url: https://mygeneset.info/metadata - # method: GET - - # - name: Show mygeneset metadata version from API - # run: | - # echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" - - # - name: Restore metadata version variable from Cache - # uses: actions/cache/restore@v3 - # with: - # path: ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache - # key: mygeneset-metadata-version - - # - name: Load mygeneset metadata version from Cache - # run: | - # file_path="${{ github.workspace }}/.cache/mygeneset-metadata-version.cache" - - # # Check if the file exists - # if [ -f "$file_path" ]; then - # # Read the file and store its content in the restored_value variable - # MYGENESET_METADATA_VERSION=$(cat "$file_path") - # echo "Restored Value: $MYGENESET_METADATA_VERSION" - # else - # echo "File does not exist or cannot be read." - # MYGENESET_METADATA_VERSION= - # fi - - # - name: Compare metadata versions - # id: compare - # run: | - # version_from_api=${{ fromJson(steps.metadataVersion.outputs.output).data.build_date }} - # version_from_cache=${{ env.MYGENESET_METADATA_VERSION }} - - # echo "version_from_api" - # echo $version_from_api - # echo "version_from_cache" - # echo $version_from_cache - - # if [ "$version_from_api" = "$version_from_cache" ]; then - # echo "No new version identified. Stopping workflow." - # echo "::error::Values are the same." - # exit 0 - # else - # echo "New version identified. Proceeding with the workflow." - # fi - - # - name: Set metadata version variable - # run: | - # echo "MYGENESET_METADATA_VERSION=${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" >> $GITHUB_ENV - - # - name: Create metadata version file in Cache folder - # run: | - # mkdir ${{ github.workspace }}/.cache/ - # echo "${{fromJson(steps.metadataVersion.outputs.output).data.build_date}}" >> ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache - # echo $(cat ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache) - - # - name: Store metadata version variable in Cache - # uses: actions/cache@v3 - # with: - # path: ${{ github.workspace }}/.cache/mygeneset-metadata-version.cache - # key: mygeneset-metadata-version - - ############## + steps: - name: Checkout source uses: actions/checkout@v3