ci: run integration tests against testnet#29
Conversation
GOL-10 Implement Testnet Environment Configuration for Integration Tests
Currently our integration tests only run against he local environment. A new
This will unblock running integration tests in CI and just be generally useful. |
- adds integration test run against testnet to gh action (required setting repository secrets) - changes env var loading to not assume file I verified the artifacts (screenshot, page html) were accessible in the case of test failure. They are indeed in the gh action logs. Just runs the integration tests against 1 go version for now. can discuss that further
sanducb
left a comment
There was a problem hiding this comment.
Looks good overall, only left a few questions
| To run all integration tests against testnet: | ||
|
|
||
| ```bash | ||
| go test ./test/integration -v -env=testnet |
There was a problem hiding this comment.
What is the difference between running the integration tests on local environment vs running them in testnet environment? Does it mean that test setups are different?
There was a problem hiding this comment.
You can run them either against the Rafiki local playground or testnet. The difference in the SDK is just configuration (different static data like wallet addresses, a little hostname massaging like bruno does, different consent screen automation etc.). The actually tests that are running are the same. Running against testnet does require some extra setup steps on the testnet side which are detailed in the readme.
Running against testnet is more-or-less required for CI (doesnt need to spin up Rafiki) but being able to run against the local Rafiki instance may prove useful for local development (no network required, can make changes in rafiki, no rafiki setup required, etc.) I started out just running against the local rafiki and then added support for running against testnet.
| t.Fatalf("Incoming payment did not complete: %v", err) | ||
| } | ||
|
|
||
| printJSON(t, incomingPayment) |
There was a problem hiding this comment.
Do we want to print responses when running integration tests on the testnet environment? I am thinking if that might have any security implications.
There was a problem hiding this comment.
I think we can probably remove this or hide behind some flag. It was useful as I was developing but now we probably dont need to log so much by default.
There was a problem hiding this comment.
dont actually think there is anything we need to be worried about security wise but I did stop this from logging in CI. instead, we can run locally with -v to print them when debugging.
closes #12 and #14
Adds configuration to tests for running against testnet, and action to do it in CI.
Run against testnet with:
Requires setting some environment variables (further specified in readme).
I setup a wallet account which can be found on 1password, for those with access to it, under
Test Wallet Account for Go SDK Tests. This repo uses these secrets for running here. In theory any wallet address could be used (say, if you wanted to run locally against your own account and dont have 1password access).