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

chore: add browser testing infrastructure #2378

Merged
merged 26 commits into from
Jun 24, 2024

Conversation

nedsalk
Copy link
Contributor

@nedsalk nedsalk commented May 23, 2024

Huge shoutout to @danielbate with whom I had multiple discussions and debugging sessions to get this working!


The idea is to run an http server that has the responsibility of launching and killing fuel-core nodes and the functionality would be transparent to launchTestNode, meaning all the @group node tests that use launchTestNode can be reused for @group browser tests as well.

This is achieved by setting an environment variable based on which the internals of launchTestNode/setupTestProviderAndWallets either use launchNode (in node tests) or send requests to the http server (browser tests).

I'll write documentation for the utility once we dogfood this in our whole test suite and verify everything works as expected. We might also put it behind a fuels cli command, but I'd also rather do that when we want to make this generally available.

closes #284, #2178

@nedsalk nedsalk added the feat Issue is a feature label May 23, 2024
@nedsalk nedsalk self-assigned this May 23, 2024
@nedsalk nedsalk changed the title feat: add browser testing infrastructure to launchTestNode feat: add browser testing infrastructure May 23, 2024
Base automatically changed from ns/feat/test-node-launcher to master June 6, 2024 16:58
@arboleya arboleya added this to the 0.x mainnet milestone Jun 12, 2024
@nedsalk nedsalk force-pushed the ns/feat/launch-test-node-in-browser-tests branch from 9ed19bd to a6c5d8d Compare June 18, 2024 14:15
@nedsalk nedsalk changed the title feat: add browser testing infrastructure chore: add browser testing infrastructure Jun 18, 2024
@github-actions github-actions bot added the chore Issue is a chore label Jun 18, 2024
@nedsalk nedsalk removed the feat Issue is a feature label Jun 19, 2024
@nedsalk nedsalk enabled auto-merge (squash) June 22, 2024 13:40
Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
80.04%(-0.92%) 72.03%(-0.52%) 76.85%(-1.13%) 80.09%(-0.92%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 internal/check-tests/src/index.ts 80%
(-10%)
66.66%
(-22.22%)
100%
(+0%)
81.81%
(-9.09%)
🔴 packages/account/src/connectors/fuel.ts 91.03%
(-5.52%)
89.33%
(+0%)
80.95%
(-14.28%)
90.72%
(-5.96%)
🔴 packages/account/src/connectors/types/local-storage.ts 60%
(-20%)
100%
(+0%)
60%
(-20%)
60%
(-20%)
🔴 packages/account/src/connectors/utils/dispatch-fuel-connector-event.ts 0%
(-100%)
100%
(+0%)
0%
(-100%)
0%
(-100%)
🔴 packages/account/src/test-utils/launchNode.ts 100%
(+0%)
86.44%
(+0%)
77.77%
(+0%)
94.95%
(+0.04%)
🔴 packages/account/src/test-utils/setup-test-provider-and-wallets.ts 80%
(-20%)
90%
(-10%)
66.66%
(-33.34%)
80%
(-20%)
🔴 ✨ packages/fuels/src/setup-launch-node-server.ts 0%
(+0%)
0%
(+0%)
0%
(+0%)
0%
(+0%)

@nedsalk nedsalk merged commit 04b58e2 into master Jun 24, 2024
21 checks passed
@nedsalk nedsalk deleted the ns/feat/launch-test-node-in-browser-tests branch June 24, 2024 14:53
petertonysmith94 added a commit that referenced this pull request Jun 25, 2024
petertonysmith94 added a commit that referenced this pull request Jun 25, 2024
* Revert "chore: add browser testing infrastructure (#2378)"

This reverts commit 04b58e2.

* chore: changeset

* chore: empty changeset

---------

Co-authored-by: Anderson Arboleya <anderson@arboleya.me>
@maschad maschad mentioned this pull request Jul 15, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make launchTestNode utility compatible with browser testing Create test to browser compatibility
5 participants