Skip to content

Commit

Permalink
Update readme, add parallel testing
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 1, 2024
1 parent ad97795 commit 178c9ae
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ jobs:
- name: Install dependencies
run: make jsdependencies

- name: Run tests
- name: Run tests (serially)
if: ${{ matrix.version == 22 && matrix.os == 'ubuntu-latest' }}
run: make jstest

- name: Run tests (in parallel)
if: ${{ !(matrix.version == 22 && matrix.os == 'ubuntu-latest') }}
run: make jstest_auto

6 changes: 4 additions & 2 deletions javascript/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ HAS_NPM?=$(shell command -v npm > /dev/null 2>&1 ; echo $$?)
test: dependencies
npx mocha

test_auto: dependencies
npx mocha --parallel

test_%: dependencies
echo "WARNING: multithreaded tests not supported on javascript"
npx mocha
npx mocha -parallel -j $*

ifneq ($(HAS_NPM),0)
ifeq ($(OS),Windows_NT) # if no NPM and Windows
Expand Down
16 changes: 15 additions & 1 deletion javascript/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ utilities for other problems to use.
Makefile
--------

There are two main recipes in this Makefile
There are four main recipes in this Makefile

dependencies
~~~~~~~~~~~~
Expand All @@ -34,6 +34,20 @@ each. This test infrastructure is based on mocha and benchmark.js,
though it currently does not export benchmark info except to fail tests
for time limit reasons.

test\_\*
~~~~~~~~

This recipe runs tests in the specified number of threads and performs
benchmarks on each. This test infrastructure is based on mocha and benchmark.js,
though it currently does not export benchmark info except to fail tests
for time limit reasons. If you specify the number of threads as `auto`, it
will default to using 1 fewer threads than you have CPUs.

lint
~~~~

This recipe runs es-lint on the JavaScript files.

Tests
-----

Expand Down

0 comments on commit 178c9ae

Please sign in to comment.