diff --git a/.github/workflows/run-indinvidual-tests.yml b/.github/workflows/run-individual-tests.yml similarity index 82% rename from .github/workflows/run-indinvidual-tests.yml rename to .github/workflows/run-individual-tests.yml index 3e4b8371f8a..a70a2394757 100644 --- a/.github/workflows/run-indinvidual-tests.yml +++ b/.github/workflows/run-individual-tests.yml @@ -4,8 +4,8 @@ on: workflow_dispatch: concurrency: - group: server-individual-tests-develop-${{ github.event_name }}-${{ github.event.number || github.event_name == 'workflow_dispatch' && github.run_id || '' }} - cancel-in-progress: false + group: server-individual-tests-lightmode-develop + cancel-in-progress: true permissions: contents: read @@ -21,7 +21,7 @@ jobs: - id: set-matrix run: | # Use grep and find to get the list of test files - matrix=$(find . -path '*/doctype/*/test_*.py' | xargs grep -l 'def test_' | awk '{ + matrix=$(find . -path '*/test_*.py' | xargs grep -l 'def test_' | sort | awk '{ # Remove ./ prefix, file extension, and replace / with . gsub(/^\.\//, "", $0) gsub(/\.py$/, "", $0) @@ -58,6 +58,7 @@ jobs: strategy: fail-fast: false matrix: ${{fromJson(needs.discover.outputs.matrix)}} + max-parallel: 14 name: Test @@ -130,4 +131,13 @@ jobs: FRAPPE_BRANCH: ${{ github.event.inputs.branch }} - name: Run Tests - run: 'cd ~/frappe-bench/ && bench --site test_site run-tests --app erpnext --module ${{ matrix.test }}' + run: | + site_name=$(echo "${{matrix.test}}" | sed -e 's/.*\.\(test_.*$\)/\1/') + echo "$site_name" + mkdir ~/frappe-bench/sites/$site_name + cp -r "${GITHUB_WORKSPACE}/.github/helper/site_config_mariadb.json" ~/frappe-bench/sites/$site_name/site_config.json + cd ~/frappe-bench/ + bench --site $site_name reinstall --yes + bench --site $site_name set-config allow_tests true + bench --site $site_name run-tests --module ${{ matrix.test }} --lightmode + diff --git a/.github/workflows/server-tests-mariadb.yml b/.github/workflows/server-tests-mariadb.yml index 2bfe5e7065d..b8e88d1b5f3 100644 --- a/.github/workflows/server-tests-mariadb.yml +++ b/.github/workflows/server-tests-mariadb.yml @@ -129,7 +129,7 @@ jobs: FRAPPE_BRANCH: ${{ github.event.client_payload.sha || github.event.inputs.branch }} - name: Run Tests - run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --total-builds ${{ strategy.job-total }} --build-number ${{ matrix.container }} --with-coverage' + run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --lightmode --app erpnext --total-builds ${{ strategy.job-total }} --build-number ${{ matrix.container }} --with-coverage' env: TYPE: server