Skip to content

Commit

Permalink
make targets to copy specs and test data, centralize test data
Browse files Browse the repository at this point in the history
  • Loading branch information
schristley committed Oct 19, 2024
1 parent 875f20e commit a1a0a9f
Show file tree
Hide file tree
Showing 17 changed files with 14,097 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/py-unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
python-version: [ '3.8' ]
steps:
- uses: actions/checkout@v2

- name: Check test data matches the global test data files
run: diff -rc tests/data ../../tests/data
shell: bash

- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/r-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Check test data matches the global test data files
run: diff -rc tests/data-tests ../../tests/data
shell: bash

- name: Install dependencies
run: |
install.packages(c("remotes", "testthat", "roxygen2", "devtools", "rcmdcheck"))
Expand Down
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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
help:
@echo ""
@echo "Helper commands for AIRR Standards repository"
@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 ""

gen-v2:
@echo "Not implemented"

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

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/

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

checks:
@echo "Running consistency checks on spec files"
python3 tests/check-consistency-formats.py

tests: python-tests r-tests js-tests

python-tests:
@echo "Running Python test suite"
cd lang/python; python3 -m unittest discover

r-tests:
@echo "Running R test suite"
cd lang/R; R -e "library(devtools); test()"

js-tests:
@echo "Running Javascript test suite"
Loading

0 comments on commit a1a0a9f

Please sign in to comment.