Skip to content

Fix #9531 preventDeafult inside passive event listener by removing un… #1

Fix #9531 preventDeafult inside passive event listener by removing un…

Fix #9531 preventDeafult inside passive event listener by removing un… #1

name: Frontend unit tests
on:
merge_group:
types: [checks_requested]
push:
branches:
- develop
- release-*
pull_request:
branches:
- develop
- release-*
jobs:
generate-job-strategy-matrix:
name: Generate job strategy matrix
runs-on: ubuntu-22.04
outputs:
job-strategy-matrix: ${{ steps.generate.outputs.job-strategy-matrix }}
steps:
- name: Generate job strategy matrix
id: generate
env:
standard-test-runs: 2
flakes-test-runs: 10
run: |
if ${{ github.event_name == 'push' && github.repository == 'oppia/oppia' && github.ref == 'refs/heads/develop'}}
then
JOB_STRATEGY_MATRIX=$(node -e "let r=[]; for(let i = 1; i <= ${{ env.flakes-test-runs }}; i++) { r.push(i) }; console.log(JSON.stringify(r));")
echo "job-strategy-matrix=$JOB_STRATEGY_MATRIX" >> $GITHUB_OUTPUT
else
JOB_STRATEGY_MATRIX=$(node -e "let r=[]; for(let i = 1; i <= ${{ env.standard-test-runs }}; i++) { r.push(i) }; console.log(JSON.stringify(r));")
echo "job-strategy-matrix=$JOB_STRATEGY_MATRIX" >> $GITHUB_OUTPUT
fi
frontend-karma-tests:
name: Run all tests
needs: generate-job-strategy-matrix
runs-on: ubuntu-22.04
strategy:
max-parallel: 25
matrix:
num_runs: ${{ fromJson(needs.generate-job-strategy-matrix.outputs.job-strategy-matrix) }}
fail-fast: false
steps:
- name: Checkout repository so that local actions can be used
uses: actions/checkout@v4
- name: Merge develop and set up Python
uses: ./.github/actions/merge-develop-and-setup-python
with:
use_cache: false
- name: Describe filesystem
run: |
pwd
ls /home/runner/work
ls /home/runner/work/oppia
ls /home/runner/work/oppia/oppia
echo $GITHUB_WORKSPACE
- name: Suppress ENOSPC error from chokidar file watcher. See https://stackoverflow.com/a/32600959.
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Initialize Docker containers
uses: ./.github/actions/install-oppia-dependencies-docker
- name: Run frontend tests (attempt ${{ matrix.num_runs }})
run: make run_tests.frontend PYTHON_ARGS="--check_coverage"
- name: Upload fronted coverage reports as an artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: frontend-coverage-${{ matrix.num_runs }}
path: /home/runner/work/oppia/karma_coverage_reports
report-failure:
name: Report failure
needs: frontend-karma-tests
runs-on: ubuntu-22.04
if: ${{ failure() && github.event_name == 'push' && github.repository == 'oppia/oppia' && github.ref == 'refs/heads/develop'}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Report failure if failed on oppia/oppia develop branch
uses: ./.github/actions/send-webhook-notification
with:
message: "A frontend test failed on the upstream develop branch."
webhook-url: ${{ secrets.BUILD_FAILURE_ROOM_WEBHOOK_URL }}