Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docs or script for running tests locally #46

Open
darrenmce opened this issue Nov 6, 2018 · 2 comments
Open

add docs or script for running tests locally #46

darrenmce opened this issue Nov 6, 2018 · 2 comments

Comments

@darrenmce
Copy link
Member

No description provided.

@darrenmce
Copy link
Member Author

#44 (comment)

@darrenmce
Copy link
Member Author

from #44:

test command:

docker run --rm -it \
  -v "$PWD:/tt" -v "/var/run/docker.sock:/var/run/docker.sock:ro" -w=/tt \
  darrenmce/tt-test-base \
  sh -c "sudo make install && DEBUG=true bats test/tt_ip.bats; cat debug.log"

also dont forget to install submodules first

git submodule sync
git submodule update --init

bit of explanation here:

the docker command just runs the tests inside the procured image that has all the dependencies already installed, so you just mount your docker socket (so it can use your daemon for docker-based tests) and then

  1. install tt
  2. run the tests (with debug on)
  3. output the debug.log (useful for bats as stdout is captured, so using the debug helper functions to output to a log is the way to debug your tests)

the git submodules are for the following bats libraries

https://github.com/ztombol/bats-support
https://github.com/ztombol/bats-assert

note: they are only required for running the tests, not for tt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant