Skip to content

Commit

Permalink
Merge pull request #10 from cjolowicz/ci-allow-running-specific-tests
Browse files Browse the repository at this point in the history
Allow running specific tests
  • Loading branch information
cjolowicz authored Aug 24, 2019
2 parents 3adac4f + 13ca277 commit 531d43c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ check:

test-heroku-16:
@echo "Running tests in docker (heroku-16)..."
@docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=heroku-16" heroku/heroku:16-build bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
@docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=heroku-16" heroku/heroku:16-build bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run $(TESTS);'
@echo ""

test-heroku-18:
@echo "Running tests in docker (heroku-18)..."
@docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=heroku-18" heroku/heroku:18-build bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
@docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=heroku-18" heroku/heroku:18-build bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run $(TESTS);'
@echo ""

buildenv-heroku-16:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ make test-heroku-18
make test-heroku-16
```

You can also specify which tests to run:

```
make test TESTS="testPython3_7 testGitEgg"
```

The tests are run via the vendored
[shunit2](https://github.com/kward/shunit2)
test framework.
13 changes: 13 additions & 0 deletions test/run
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,17 @@ assertFile() {
assertEquals "$1" "$(cat ${compile_dir}/$2)"
}

# If tests are passed as command-line arguments, only run those tests.
if [ $# -gt 0 ]; then
shunit_funcs_="$*"
set --

suite() {
for shunit_func_ in ${shunit_funcs_}; do
suite_addTest ${shunit_func_}
done
unset shunit_func_
}
fi

source $(pwd)/test/shunit2

0 comments on commit 531d43c

Please sign in to comment.