-
Notifications
You must be signed in to change notification settings - Fork 12
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
Allow local testing #90
Allow local testing #90
Conversation
6ae8743
to
f73be4d
Compare
And not in Docker. This patch is to prove things work, so I've just moved one test across (though most of the changes are in test setup that can be re-used across tests). If this gets tractions, more tests could be moved across. Reasons for this approach: * Simplicity: tests have no external requirements besides `git` * Debugability: running locally you can spin up a debugger (or just sleep in tests) and inspect the running environment. This is possible with Docker, but more of a hassle * Reproducibility: tests are decoupled from the user's environment, so failures should be reproducible This is achieved via: * Using git's worktree's[1] to run things like `git commit` without modifying the working repo * Having the tests build a strongbox binary that we can then configure `git` with (built once per run) * Adding some test setup with actual keys etc. rather than relying on the user having keys define For posterity, the commands to setup the keys etc go run . -identity-file ./testdata/.strongbox_identity -gen-identity test-key grep --only-matching --perl-regexp '(?<=# public key: ).*' ./testdata/.strongbox_identity > ./testdata/.strongbox_recipient Link: https://git-scm.com/docs/git-worktree [1]
f73be4d
to
f12460d
Compare
This is really awesome - love it. If you are happy to move all tests, will merge 👍 |
yes, this is good. I think we should also use |
Could you elaborate on this? For clarity: At the moment all the config setup is handled by the
Is the a reason for preferring this over the current approach? Currently the files used by STRONGBOX are static and just stored under |
current approach is individual test will do its own initialisation and config. where as I was suggesting to share some of it between tests using |
Matt can correct me - but I think this is the case because PR is a POC and we'd move this logic to main in full PR. |
👍 I moved the config to be a file under |
do you want all tests in one PR, or happy to merge this as a starting point and then I can move some more tests on top of this? |
I would be happy to merge this and have another PR to move the other tests 👍 |
3087ce9
to
c6513d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
Move integration testing to run locally
And not in Docker. This patch is to prove things work, so I've just
moved one test across (though most of the changes are in test setup that
can be re-used across tests). If this gets tractions, more tests could
be moved across. Reasons for this approach:
git
sleep in tests) and inspect the running environment. This is possible
with Docker, but more of a hassle
failures should be reproducible
This is achieved via:
git commit
withoutmodifying the working repo
git
with (built once per run)user having keys define
For posterity, the commands to setup the keys etc
Link: https://git-scm.com/docs/git-worktree [1]
Add run of local tests in GitHub