From 178c9ae0471f5433f6c91b92b963fc935c6327af Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Mon, 1 Jul 2024 04:34:52 -0500 Subject: [PATCH] Update readme, add parallel testing --- .github/workflows/javascript.yml | 7 ++++++- javascript/Makefile | 6 ++++-- javascript/README.rst | 16 +++++++++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 7ebaf593..38a6a72a 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -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 + diff --git a/javascript/Makefile b/javascript/Makefile index 2693d7c3..5c8e628a 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -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 diff --git a/javascript/README.rst b/javascript/README.rst index 50d2dead..b621546d 100644 --- a/javascript/README.rst +++ b/javascript/README.rst @@ -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 ~~~~~~~~~~~~ @@ -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 -----