Skip to content

Commit

Permalink
sync tests for langs
Browse files Browse the repository at this point in the history
  • Loading branch information
schristley committed Oct 19, 2024
1 parent 5120bef commit 5e2cfe1
Show file tree
Hide file tree
Showing 27 changed files with 2,507 additions and 942 deletions.
20 changes: 18 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,25 @@ software. For all cases, you will want a local copy of the github repository.
git clone https://github.com/airr-community/airr-standards.git
A Makefile is provided to simplify tasks such as copying spec files to the lang
directories, copying test data, running tests and checks, and building documentation.
The default make target will display a help info for all targets.

.. code-block:: bash
make
If your local environment does not have the appropriate software, you can build
and use the docker container. You will need python3, R and npm to run tests for
all languages.

If you will be working in a docker container, you can pull down the airr-standards
image, which has all of the prerequisites installed, or you can use your own image.
The airr-standards image provides a python3 environment.
image from docker hub, which has all of the prerequisites installed,
or you can build your own image. Note: automated builds are not performed on docker
hub so the ``latest`` tag is often out of date. It is generally safe to build
your own container from your local source.
The airr-standards image installs the reference library for all languages and
builds the documentation.

.. code-block:: bash
Expand Down
38 changes: 22 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
# helper commands for keeping the language directories in sync

# note: "help" MUST be the first target in the file,
# when the user types "make" they should get help info
# note: "help" MUST be the first target in the file, so
# when the user types "make" they get help info by default
help:
@echo ""
@echo "Helper commands for AIRR Standards repository"
@echo "---------------------------------------------"
@echo ""
@echo "make gen-v2 -- Generate OpenAPI V2 spec from the V3 spec"
@echo "make build-docs -- Build documentation"
@echo "make spec-copy -- Copy spec files to language directories"
@echo "make data-copy -- Copy test data files to language directories"
@echo "make checks -- Run consistency checks on spec files"
@echo "make tests -- Run all language test suites"
@echo "make python-tests -- Run Python test suite"
@echo "make r-tests -- Run R test suite"
@echo "make js-tests -- Run Javascript test suite"
@echo "make spec-copy -- Copy spec files to language directories"
@echo "make data-copy -- Copy test data files to language directories"
@echo ""
@echo "make docker-latest -- Build docker image with latest tag"
@echo ""
@echo "make checks -- Run consistency checks on spec files"
@echo "make tests -- Run all language test suites"
@echo "make python-tests -- Run Python test suite"
@echo "make r-tests -- Run R test suite"
@echo "make js-tests -- Run Javascript test suite"
@echo ""
@echo "make build-docs -- Build documentation"
@echo ""

gen-v2:
@echo "Not implemented"

build-docs:
sphinx-build -a -E -b html docs docs/_build/html

docker-latest:
@echo "Building latest docker image"
docker build -f docker/Dockerfile -t airrc/airr-standards:latest .

spec-copy:
@echo "Copying specs to language directories"
cp specs/airr-schema.yaml lang/python/airr/specs
cp specs/airr-schema-openapi3.yaml lang/python/airr/specs
cp specs/airr-schema.yaml lang/R/inst/extdata
cp specs/airr-schema-openapi3.yaml lang/R/inst/extdata
# cp specs/airr-schema.yaml lang/js/
# cp specs/airr-schema-openapi3.yaml lang/js/
cp specs/airr-schema-openapi3.yaml lang/js/

data-copy:
@echo "Copying test data to language directories"
cp tests/data/* lang/python/tests/data
cp tests/data/* lang/R/tests/data-tests
cp tests/data/* lang/js/tests/data

checks:
@echo "Running consistency checks on spec files"
Expand All @@ -53,3 +58,4 @@ r-tests:

js-tests:
@echo "Running Javascript test suite"
cd lang/js; npm test
Loading

0 comments on commit 5e2cfe1

Please sign in to comment.