๐งช Testing VEP Polaris
This project includes test scripts to verify that each tool behaves as expected. Tests are written in portable Bash and use only standard Unix utilities.
๐ง Requirements
- Bash (4.x or higher)
- Core Unix utilities:
grep
,gzip
,head
,mkdir
,rm
,echo
, etc. - Optional: Node.js (for
npm run test
command more easily)
๐ Run All Tests
If you've already installed the toolkit:
npm test
This runs the run-tests.sh
script, which locates and executes all test scripts in test/
.
Alternatively, run it manually:
chmod +x run-tests.sh # needs to be run initially
./run-tests.sh
This script will:
- Find all test scripts in the
test/
directory (with filenames liketest-*.sh
) - Run each one
- Exit with an error if any test fails
๐งช Run an Individual Test
To run a single test directly:
bash test/test-plugin-inspect.sh
Useful when debugging or developing a specific tool.
๐ Adding a New Test
To add a new test script:
- Name it
test/test-<tool>.sh
-
Make it executable:
bash chmod +x test/test-yourtool.sh
-
It will automatically be picked up by
./run-tests.sh
โ Expected Output
If all tests pass, you'll see something like:
๐ฌ Running all VEP Polaris tests...
โก๏ธ Running: test/test-plugin-inspect.sh
โ PASS: Plain numeric chromosome format recognized
โ PASS: chrN format recognized
โ PASS: Warning for comment-only file shown
โ
All tests passed!
If a test fails, it will print a clear failure message and exit:
โ FAIL: Expected output to contain: plain.tsv
๐ค Continuous Integration (Optional)
To include this in GitHub Actions or another CI tool, add a step to your workflow:
- name: Run VEP Polaris tests
run: ./run-tests.sh
For more information about individual tools, see the documentation index.
vep-polaris <tool> --help