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

Run Keep Client integration tests in CI #3589

Merged
merged 8 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,23 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache-new
context: .

# Since build-push-action doesn't support outputing an image to multiple outputs
# we need to save it in a separate step. See: https://github.com/moby/buildkit/issues/1555
# Once multiple outputs are supported we can replace this step with
# `outputs` property configured in `Build Docker Build Image`:
# outputs: |
# type=image
# type=docker,dest=/tmp/go-build-env-image.tar
- name: Save Docker Build Image
run: |
docker save --output /tmp/go-build-env-image.tar go-build-env

- name: Upload Docker Build Image
uses: actions/upload-artifact@v3
with:
name: go-build-env-image
path: /tmp/go-build-env-image.tar

- name: Run Go tests
run: |
docker run \
Expand Down Expand Up @@ -263,3 +280,27 @@ jobs:
with:
version: "2022.1.3"
install-go: false

client-integration-test:
needs: client-build-test-publish
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Download Docker Build Image
uses: actions/download-artifact@v3
with:
name: go-build-env-image
path: /tmp

- name: Load Docker Build Image
run: |
docker load --input /tmp/go-build-env-image.tar

- name: Run Go Integration Tests
run: |
docker run \
--workdir /go/src/github.com/keep-network/keep-core \
go-build-env \
gotestsum -- -tags=integration ./...
10 changes: 5 additions & 5 deletions pkg/bitcoin/electrum/electrum_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ var testConfigs = map[string]testConfig{
"electrs-esplora tcp": {
clientConfig: Config{
URL: "tcp://electrum.blockstream.info:60001",
RequestTimeout: timeout,
RequestRetryTimeout: timeout * 5,
RequestTimeout: timeout * 3,
RequestRetryTimeout: timeout * 10,
},
errorMessages: expectedErrorMessages{
missingTransaction: "errNo: 0, errMsg: missing transaction",
Expand All @@ -61,8 +61,8 @@ var testConfigs = map[string]testConfig{
"electrs-esplora ssl": {
clientConfig: Config{
URL: "ssl://electrum.blockstream.info:60002",
RequestTimeout: timeout,
RequestRetryTimeout: timeout * 5,
RequestTimeout: timeout * 3,
RequestRetryTimeout: timeout * 10,
},
errorMessages: expectedErrorMessages{
missingTransaction: "errNo: 0, errMsg: missing transaction",
Expand All @@ -89,7 +89,7 @@ var testConfigs = map[string]testConfig{
RequestRetryTimeout: timeout * 2,
},
errorMessages: expectedErrorMessages{
missingTransaction: "errNo: 2, errMsg: daemon error: DaemonError({'message': 'Transaction not found.', 'code': -1})",
missingTransaction: "errNo: 2, errMsg: daemon error: DaemonError({'code': -5, 'message': 'No such mempool or blockchain transaction. Use gettransaction for wallet transactions.'})",
missingBlockHeader: "errNo: 1, errMsg: height 4,294,967,295 out of range",
missingTransactionInBlock: "errNo: 1, errMsg: tx aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa not in block at height 123,456",
},
Expand Down