test: Allow integration tests to run against any accessible cheqd resolver #247
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a very mechanical/repetitive, although large change to the integration test suite.
Problem Addressed:
The integration tests hardcode the host portion of all test Cheqd DID URLs to be localhost:8080. Whilst this works when running on a developers local machine and on GitHub it doesn't work for Gitlab pipelines which need a docker-in-docker container addressed as 'docker:8080'. Additionally with this set of changes it will be possible to run the integration tests against any publicly accessible/deployed cheqd resolver which could be useful in diagnosing field issues/anomalies.
Solution submitted
This change introduces an integration testing environment string variable called
SUT_HOST_ADDRESS
.If the environment variable is set then the
SUTHost
test constant is set to that value intests/constants/constants.go
. If the environment variable is NOT set then the default behaviour is maintained withSUTHost
being set tolocalhost:8080
.All current integration tests were changed to use
SUTHost
when creating DidURL using fmt.Sprintf() in place of the hardcodedlocalhost:8080