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

test: bridge e2e testing #57

Merged
merged 28 commits into from
Sep 16, 2024
Merged

test: bridge e2e testing #57

merged 28 commits into from
Sep 16, 2024

Conversation

vcastellm
Copy link
Contributor

@vcastellm vcastellm commented Sep 3, 2024

Why

As we progress we need to test many aspects of the system, we already commented that using Go to orchestrate e2e tests is not appropriate so we want to find a way to glue all the tests.

Naturally we've been leaning towards using multiple CLI tools: cast, kurtosis, yq, polycli, k6, etc. and because they can do all, so choosing one tool doesn't make much sense.

So, naturally we've felt back to bash for testing, but bash is not testing friendly, so we need a framework to run tests in bash, enter: Bats, it's a testing framework that uses the standard TAP protocol playing nicely with CI systems.

image

Description

This is a PoC on how we can use Bats as the testing framework for e2e tests, with a bridging example making use of multiple command line tools and pre-existing bash tests slightly modified to use Bats.

CI will be happy with this.

@vcastellm vcastellm requested a review from a team September 3, 2024 11:06
test/bridge-e2e.bats Outdated Show resolved Hide resolved
@vcastellm vcastellm marked this pull request as draft September 3, 2024 11:12
@vcastellm vcastellm changed the title tests: bridge testing with bats PoC test: bridge testing with bats PoC Sep 10, 2024
@vcastellm vcastellm changed the title test: bridge testing with bats PoC test: bridge e2e testing Sep 10, 2024
@Stefan-Ethernal Stefan-Ethernal changed the title test: bridge e2e testing tests: bridge e2e testing Sep 10, 2024
@Stefan-Ethernal Stefan-Ethernal changed the title tests: bridge e2e testing test: bridge e2e testing Sep 10, 2024
@vcastellm vcastellm marked this pull request as ready for review September 12, 2024 13:17
test/helpers/lxly-bridge-test.bash Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
test/bridge-e2e.bats Outdated Show resolved Hide resolved
test/bridge-e2e.bats Outdated Show resolved Hide resolved
test/bridge-e2e.bats Show resolved Hide resolved
test/bridge-e2e.bats Outdated Show resolved Hide resolved
test/bridge-e2e.bats Outdated Show resolved Hide resolved
test/bridge-e2e.bats Outdated Show resolved Hide resolved
@vcastellm
Copy link
Contributor Author

There's new linting errors not sure why, they should be fixed in a new PR

test/bridge-e2e.bats Show resolved Hide resolved
test/bridge-e2e.bats Outdated Show resolved Hide resolved
@joanestebanr
Copy link
Contributor

Checking PR semantic test is failing

Stefan-Ethernal and others added 8 commits September 16, 2024 10:58
* feat: add helper functions for contract deployment and sending transactions using cast commands

* feat: send EOA transaction test basic

* feat: add CDK_ERIGON_NODE_NAME var

* feat: invoke _common_setup function

* feat: deploy ERC20Mock contract E2E test

* feat: more strict assertions and use run instead of $

* feat: tweaks

* fix: change the way transaction hash is extracted

* fix: change the way transactionHash gets fetched from the output

* fix: cast call helper function and invocation of balanceOf function

* test: use RAW_PRIVATE_KEY env variable for sender private key

* fix: address feedback from @vcastellm

* fix: Linters warning fixes (#74)

* feat: use the latest golangci-lint version and fix config warnings

* fix: linter warnings

* fix: linter warnings (part 2)

* fix: propagate the error from aggregator.Start

* fix: format golangci config file

* fix: suppress gosec overflow issues

* fix: exclude G115 gosec linter rule

* fix: use crypto/rand number generator
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
33.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@Stefan-Ethernal
Copy link
Collaborator

Checking PR semantic test is failing

@joanestebanr It is because of this commit: 3be3e46. Probably not important to deal with it at this point.

@vcastellm vcastellm merged commit c647413 into develop Sep 16, 2024
7 of 9 checks passed
@vcastellm vcastellm deleted the poc_bats branch September 16, 2024 14:42
Stefan-Ethernal added a commit that referenced this pull request Sep 17, 2024
* tests: PoC bridge testing with bats
* Run bats in e2e
* Remove unused make lines
* test: Send EOA and deploy contract E2E tests using Bats (#69)
* feat: add helper functions for contract deployment and sending transactions using cast commands
* feat: send EOA transaction test basic
* feat: deploy ERC20Mock contract E2E test

---------

Co-authored-by: Stefan Negovanović <93934272+Stefan-Ethernal@users.noreply.github.com>
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.

5 participants