Skip to content

ci: run integration tests against testnet#29

Merged
BlairCurrey merged 9 commits intomainfrom
blair/gol-10
Oct 30, 2025
Merged

ci: run integration tests against testnet#29
BlairCurrey merged 9 commits intomainfrom
blair/gol-10

Conversation

@BlairCurrey
Copy link
Copy Markdown
Collaborator

@BlairCurrey BlairCurrey commented Sep 26, 2025

closes #12 and #14

Adds configuration to tests for running against testnet, and action to do it in CI.

Run against testnet with:

go test ./test/integration -env=testnet

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).

@linear
Copy link
Copy Markdown

linear bot commented Sep 26, 2025

GOL-10 Implement Testnet Environment Configuration for Integration Tests

Currently our integration tests only run against he local environment. A new Environment configuration should be added for testnet. Testnet will bring some differences from teh local environment:

  • It should not need to do as much work as the local environment, which passes in some pre/post request hooks and an custom http client to help massage the url/headers (mostly localhost vs. resolved hostname issues).
  • Will probably need to change some configuration to read from environment since there will be sensitive info and credentials which vary by user (key, wallet address, etc.)

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
@BlairCurrey BlairCurrey changed the title Run integration tests against testnet ci: run integration tests against testnet Oct 22, 2025
Copy link
Copy Markdown

@sanducb sanducb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, only left a few questions

To run all integration tests against testnet:

```bash
go test ./test/integration -v -env=testnet
Copy link
Copy Markdown

@sanducb sanducb Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

@BlairCurrey BlairCurrey Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to print responses when running integration tests on the testnet environment? I am thinking if that might have any security implications.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@BlairCurrey BlairCurrey merged commit 6ccf0da into main Oct 30, 2025
7 checks passed
@BlairCurrey BlairCurrey deleted the blair/gol-10 branch October 30, 2025 19:20
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

Successfully merging this pull request may close these issues.

Implement Testnet Environment Configuration for Integration Tests

3 participants