From 7ef21b1bfa6eadb30bff24701564717b2564660d Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 5 Dec 2024 10:57:08 +0200 Subject: [PATCH] Create 2 files for PR tests --- .github/workflows/nim_waku_PR.yml | 25 +++++++ .github/workflows/test_PR_image.yml | 109 ++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 .github/workflows/nim_waku_PR.yml create mode 100644 .github/workflows/test_PR_image.yml diff --git a/.github/workflows/nim_waku_PR.yml b/.github/workflows/nim_waku_PR.yml new file mode 100644 index 00000000..62dab74d --- /dev/null +++ b/.github/workflows/nim_waku_PR.yml @@ -0,0 +1,25 @@ +name: Nim -> Nim Waku Interop Tests + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: false + +on: + schedule: + - cron: '0 5 * * *' + workflow_dispatch: + workflow_call: + inputs: + node_nwaku: + required: true + type: string + +jobs: + test-common: + uses: ./.github/workflows/test_PR_image.yml + secrets: inherit + with: + node1: ${{ inputs.node_nwaku }} + node2: "wakuorg/nwaku:latest" + additional_nodes: "wakuorg/nwaku:latest,wakuorg/nwaku:latest,wakuorg/nwaku:latest" + caller: "nim" \ No newline at end of file diff --git a/.github/workflows/test_PR_image.yml b/.github/workflows/test_PR_image.yml new file mode 100644 index 00000000..ba102571 --- /dev/null +++ b/.github/workflows/test_PR_image.yml @@ -0,0 +1,109 @@ + +name: Interop Tests Common + +on: + workflow_call: + inputs: + node1: + required: true + type: string + description: "Node that usually publishes messages. Used for all tests" + default: "wakuorg/go-waku:latest" + node2: + required: true + description: "Node that usually queries for published messages. Used for all tests" + type: string + default: "wakuorg/nwaku:latest" + additional_nodes: + required: false + description: "Additional optional nodes used in e2e tests, separated by ," + type: string + default: "wakuorg/nwaku:latest,wakuorg/go-waku:latest,wakuorg/nwaku:latest" + caller: + required: false + description: "Workflow caller. Used in reporting" + type: string + +env: + FORCE_COLOR: "1" + NODE_1: ${{ inputs.node1 }} + NODE_2: ${{ inputs.node2 }} + ADDITIONAL_NODES: ${{ inputs.additional_nodes }} + CALLER: ${{ inputs.caller || 'manual' }} + RLN_CREDENTIALS: ${{ secrets.RLN_CREDENTIALS }} + +jobs: + + tests: + name: tests + runs-on: ubuntu-latest + timeout-minutes: 120 + steps: + + - uses: actions/checkout@v4 + with: + repository: waku-org/waku-interop-tests + ref: smoke_tests + + - uses: actions/setup-python@v4 + with: + + python-version: '3.12' + cache: 'pip' + + - run: pip install -r requirements.txt + + - name: Run tests + run: | + pytest -m 'smoke' -n 4 --dist loadgroup --reruns 2 --alluredir=allure-result + + - name: Get allure history + if: always() + uses: actions/checkout@v4 + with: + ref: gh-pages + path: gh-pages + + - name: Setup allure report + uses: simple-elf/allure-report-action@master + if: always() + id: allure-report + with: + allure_results: allure-results + gh_pages: gh-pages/${{ env.CALLER }} + allure_history: allure-history + keep_reports: 30 + report_url: https://waku-org.github.io/waku-interop-tests/${{ env.CALLER }} + + - name: Deploy report to Github Pages + uses: peaceiris/actions-gh-pages@v3 + if: always() + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: allure-history + destination_dir: ${{ env.CALLER }} + + - name: Create job summary + if: always() + env: + JOB_STATUS: ${{ job.status }} + run: | + echo "## Run Information" >> $GITHUB_STEP_SUMMARY + echo "- **Event**: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY + echo "- **Actor**: ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY + echo "- **Node1**: ${{ env.NODE_1 }}" >> $GITHUB_STEP_SUMMARY + echo "- **Node2**: ${{ env.NODE_2 }}" >> $GITHUB_STEP_SUMMARY + echo "- **Additonal Nodes**: ${{ env.ADDITIONAL_NODES }}" >> $GITHUB_STEP_SUMMARY + echo "## Test Results" >> $GITHUB_STEP_SUMMARY + echo "Allure report will be available at: https://waku-org.github.io/waku-interop-tests/${{ env.CALLER }}/${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY + if [ "$JOB_STATUS" != "success" ]; then + echo "There are failures with nwaku node. cc <@&1111608257824440330>" >> $GITHUB_STEP_SUMMARY + fi + { + echo 'JOB_SUMMARY<> $GITHUB_ENV + +