-
Notifications
You must be signed in to change notification settings - Fork 77
feat: testcontainers integration #386
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
Merged
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
27fecfc
chore: add testcontainer packages
viraj124 d37fef0
chore: generate new fuel wallets during setup
viraj124 5d2b8ce
chore: make minor adjustments in existing docker files
viraj124 79df68f
feat: add testcontainers setup
viraj124 1aa882f
test: add testcontainer integration in non-fork tests
viraj124 414b372
chore: resolve merge conflict
viraj124 1f0c731
feat: integrate fork tests with testcontainer
viraj124 f98dae6
test: small touchups
viraj124 48446e6
chore: delete current docker setup related files
viraj124 28d5f1a
chore: remove container start command
viraj124 518c950
chore: update commands in upgrade test suite ci
viraj124 8d473b7
feat: testcontainers integration for remaining tests
viraj124 cd6a3a0
chore: add changeset
viraj124 6d431b9
chore: update comments
viraj124 7b7c495
chore: debug ci
viraj124 14fd01b
chore: formatting
viraj124 5fab8da
fix: ts linting
viraj124 ca02355
chore: testcontainer integration in ci
viraj124 a613ea1
chore: more ci updates
viraj124 01fbad2
chore: add wait strategy for l1 container
viraj124 8b14d68
chore: remove healthcheck
viraj124 bdd0f71
chore: comment out deployment serve port
viraj124 efb6ff2
chore: more l1 container updates
viraj124 96d04c9
chore: add logging
viraj124 c95d34b
chore: fix ts linting
viraj124 9eac428
chore: add debug arg in ci
viraj124 8466c8d
chore: remove env args in ci
viraj124 4c3499e
chore: add typing and revert debugging changes
viraj124 91e35e9
chore: remove logging
viraj124 9d6d49b
fix: remove shell scripting to build docker images
viraj124 3ff9141
chore: rename vars
viraj124 bab0876
chore: resolve merge conflicts
viraj124 8e2f0be
chore: update lock file
viraj124 332dd8c
chore: add try/catch block
viraj124 1e3ca86
chore: debug ci
viraj124 db7c8a5
chore: revert latest change
viraj124 32dc415
chore: resolve conflicts
viraj124 981b7db
chore: debug ci
viraj124 c6a3b6f
chore: update command in yml
viraj124 dd3ad58
chore: revert to original docker setup to build images externally
viraj124 a26a512
chore: debug tests ci
viraj124 132db83
chore: uncomment tests
viraj124 2827212
chore: remove comment
viraj124 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@fuel-bridge/solidity-contracts': minor | ||
'@fuel-bridge/test-utils': minor | ||
--- | ||
|
||
testcontainer integration for all intergration tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { config as dotEnvConfig } from 'dotenv'; | ||
import * as path from 'path'; | ||
import type { | ||
StartedTestContainer, | ||
StartedDockerComposeEnvironment, | ||
} from 'testcontainers'; | ||
import { DockerComposeEnvironment } from 'testcontainers'; | ||
|
||
dotEnvConfig(); | ||
|
||
export type Containers = { | ||
postGresContainer: StartedTestContainer; | ||
l1_node: StartedTestContainer; | ||
fuel_node: StartedTestContainer; | ||
block_committer: StartedTestContainer; | ||
}; | ||
|
||
const PROJECT_ROOT = path.resolve(__dirname, '../../../'); | ||
let environment: StartedDockerComposeEnvironment; | ||
|
||
// responsible for starting all containers | ||
export async function startContainers() { | ||
// building images externally | ||
console.log('Setting up environment using docker compose...'); | ||
environment = await new DockerComposeEnvironment( | ||
path.resolve(PROJECT_ROOT, 'docker'), | ||
'docker-compose.yml' | ||
) | ||
.withBuild() | ||
.up(); | ||
|
||
console.log('Environment setup done...'); | ||
|
||
const postGresContainer = environment.getContainer('db-1'); | ||
|
||
const l1_node: StartedTestContainer = environment.getContainer('l1_chain-1'); | ||
const fuel_node: StartedTestContainer = | ||
environment.getContainer('fuel_core-1'); | ||
const block_committer: StartedTestContainer = environment.getContainer( | ||
'fuel_block_commiter-1' | ||
); | ||
|
||
return { postGresContainer, l1_node, fuel_node, block_committer }; | ||
} | ||
|
||
export async function stopEnvironment(): Promise<void> { | ||
console.log('Stopping environment...'); | ||
if (environment) { | ||
await environment.down(); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.