Skip to content
Open
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
66 changes: 0 additions & 66 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,72 +157,6 @@ jobs:
- name: Test
run: pnpm test:unit

test-integration:
name: Test (Integration) - ${{ matrix.config.name }}
runs-on: ubuntu-latest
strategy:
matrix:
config:
- name: Nitro contracts v3.2 - Custom gas token with 18 decimals
nitro-contracts-branch: v3.2.0
args: --tokenbridge --l3node --l3-token-bridge --l3-fee-token
decimals: 18

- name: Nitro contracts v3.2 - Custom gas token with 6 decimals
nitro-contracts-branch: v3.2.0
args: --tokenbridge --l3node --l3-token-bridge --l3-fee-token --l3-fee-token-decimals 6
decimals: 6

- name: Nitro contracts v2.1 - Custom gas token with 18 decimals
nitro-contracts-branch: v2.1.3
args: --tokenbridge --l3node --l3-token-bridge --l3-fee-token
decimals: 18

- name: Nitro contracts v2.1 - Custom gas token with 6 decimals
nitro-contracts-branch: v2.1.3
args: --tokenbridge --l3node --l3-token-bridge --l3-fee-token --l3-fee-token-decimals 6
decimals: 6

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.30.3
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
with:
install-command: pnpm install --frozen-lockfile
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}

- name: Set up the local node
uses: OffchainLabs/actions/run-nitro-test-node@feat-simplify
with:
nitro-testnode-ref: release
nitro-contracts-branch: ${{ matrix.config.nitro-contracts-branch }}
args: ${{ matrix.config.args }}

- name: Copy .env
run: cp ./.env.example ./.env

- name: Build
run: pnpm build

- name: Test
run: |
INTEGRATION_TEST_DECIMALS=${{matrix.config.decimals}} \
INTEGRATION_TEST_NITRO_CONTRACTS_BRANCH=${{matrix.config.nitro-contracts-branch}} \
pnpm test:integration

test-integration-arbitrum-testnode:
name: Test (Integration) - Arbitrum Testnode - ${{ matrix.config.name }}
runs-on: ubuntu-latest
Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,12 @@ arbitrum-chain-sdk prepareChainConfig '{
}'
```

## Run integration tests
## Run integration tests locally

Clone the branch `release` of [nitro-testnode](https://github.com/OffchainLabs/nitro-testnode), and run the testnode using the following arguments:
With Docker running, start `arbitrum-testnode` and run the integration tests locally:

```bash
./test-node.bash --init --tokenbridge --l3node --l3-fee-token --l3-token-bridge
```

Then, run the integration tests:

```bash
pnpm test:integration
pnpm test:integration:local
```

## Examples
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"test:type": "vitest --config vitest.type.config.mts",
"test:unit": "vitest --config vitest.unit.config.mts",
"test:integration": "vitest --config vitest.integration.config.mts",
"test:integration:arbitrum-testnode": "bash ./scripts/test-integration-arbitrum-testnode.sh",
"test:integration:local": "bash ./scripts/test-integration-arbitrum-testnode.sh",
"postinstall": "patch-package",
"lint": "eslint . --cache",
"lint:fix": "eslint . --fix --cache",
Expand Down
12 changes: 0 additions & 12 deletions src/testHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,30 +146,22 @@ function readFirstExistingContainerJson<T>(container: string, paths: string[]):

function getInformationFromTestnodeContainer(container: string): TestnodeInformation {
const deploymentJson = readFirstExistingContainerJson<TestnodeDeploymentJson>(container, [
'/config/deployment.json',
'/config/l2_deployment.json',
'/opt/arbitrum-testnode/export-config/deployment.json',
'/opt/arbitrum-testnode/export-config/l2_deployment.json',
]);
const l3DeploymentJson = readFirstExistingContainerJson<Required<TestnodeDeploymentJson>>(
container,
[
'/config/l3deployment.json',
'/config/l3_deployment.json',
'/opt/arbitrum-testnode/export-config/l3deployment.json',
'/opt/arbitrum-testnode/export-config/l3_deployment.json',
],
);
const sequencerConfig = readFirstExistingContainerJson<TestnodeNodeConfig>(container, [
'/config/sequencer_config.json',
'/config/l2-nodeConfig.json',
'/opt/arbitrum-testnode/export-config/sequencer_config.json',
'/opt/arbitrum-testnode/export-config/l2-nodeConfig.json',
]);

const l3SequencerConfig = readFirstExistingContainerJson<TestnodeNodeConfig>(container, [
'/config/l3node_config.json',
'/config/l3-nodeConfig.json',
'/opt/arbitrum-testnode/export-config/l3node_config.json',
'/opt/arbitrum-testnode/export-config/l3-nodeConfig.json',
]);
Expand Down Expand Up @@ -199,10 +191,6 @@ export function getInformationFromTestnode(): TestnodeInformation {
'arbitrum-testnode-l3-eth',
'arbitrum-testnode-l2',
'arbitrum-testnode',
'nitro_sequencer_1',
'nitro-sequencer-1',
'nitro-testnode-sequencer-1',
'nitro-testnode_sequencer_1',
]),
).filter((container): container is string => typeof container === 'string' && container !== '');

Expand Down
Loading