Skip to content

Commit

Permalink
feat: use boojum-integration branch of in-memory node for testing CI (#…
Browse files Browse the repository at this point in the history
…43)

* ci: using boojum branch of test node

* test: reenable temporarily disabled tests

* ci: test node in background

* ci: caching for era-test-node

* chore: downgrading hardhat version to fix test execution

* ci: ci to run on dev and main push

* chore: set hardhat to fix v2.16.0

* ci: print era_test_node logs

* ci: change tag to commit SHA of dependency
  • Loading branch information
benceharomi authored Oct 20, 2023
1 parent 08d54d5 commit 0d38b70
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 139 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: "CI"

on: pull_request
on:
pull_request:
push:
branches:
- dev
- main

jobs:
build:
Expand Down Expand Up @@ -100,8 +105,17 @@ jobs:
node-version: 18.18.0
cache: yarn

- name: Use era-test-node for testing
uses: dutterbutter/era-test-node-action@latest
- name: Use Nightly Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-04-17

- name: Use era_test_node for testing
uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941
with:
crate: era_test_node
git: https://github.com/matter-labs/era-test-node.git
branch: boojum-integration

- name: Install dependencies
run: yarn
Expand All @@ -119,9 +133,16 @@ jobs:
contracts/precompiles/artifacts
bootloader/build
- name: Start era_test_node
run: era_test_node run > /dev/null 2>&1 &

- name: Run tests
run: yarn test

- name: Print output logs of era_test_node
if: always()
run: cat era_test_node.log

test_bootloader:
needs: [build, lint]
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@nomiclabs/hardhat-solpp": "^2.0.1",
"commander": "^9.4.1",
"ethers": "^5.7.0",
"hardhat": "^2.11.0",
"hardhat": "=2.16.0",
"preprocess": "^3.2.0",
"zksync-web3": "^0.14.3"
},
Expand Down
22 changes: 11 additions & 11 deletions test/AccountCodeStorage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ describe('AccountCodeStorage tests', function () {
).to.be.revertedWith('Callable only by the deployer system contract');
});

xit('failed to set with constructed bytecode', async () => {
it('failed to set with constructed bytecode', async () => {
await expect(
accountCodeStorage
.connect(deployerAccount)
.storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH)
).to.be.revertedWith('Code hash is not for a contract on constructor');
});

xit('successfully stored', async () => {
it('successfully stored', async () => {
await accountCodeStorage
.connect(deployerAccount)
.storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH);
Expand All @@ -67,15 +67,15 @@ describe('AccountCodeStorage tests', function () {
).to.be.revertedWith('Callable only by the deployer system contract');
});

xit('failed to set with constructing bytecode', async () => {
it('failed to set with constructing bytecode', async () => {
await expect(
accountCodeStorage
.connect(deployerAccount)
.storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH)
).to.be.revertedWith('Code hash is not for a constructed contract');
});

xit('successfully stored', async () => {
it('successfully stored', async () => {
await accountCodeStorage
.connect(deployerAccount)
.storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH);
Expand All @@ -95,7 +95,7 @@ describe('AccountCodeStorage tests', function () {
);
});

xit('failed to mark already constructed bytecode', async () => {
it('failed to mark already constructed bytecode', async () => {
await accountCodeStorage
.connect(deployerAccount)
.storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH);
Expand All @@ -107,7 +107,7 @@ describe('AccountCodeStorage tests', function () {
await unsetCodeHash(accountCodeStorage, RANDOM_ADDRESS);
});

xit('successfully marked', async () => {
it('successfully marked', async () => {
await accountCodeStorage
.connect(deployerAccount)
.storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH);
Expand All @@ -127,7 +127,7 @@ describe('AccountCodeStorage tests', function () {
expect(await accountCodeStorage.getRawCodeHash(RANDOM_ADDRESS)).to.be.eq(ethers.constants.HashZero);
});

xit('non-zero', async () => {
it('non-zero', async () => {
await accountCodeStorage
.connect(deployerAccount)
.storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH);
Expand All @@ -152,7 +152,7 @@ describe('AccountCodeStorage tests', function () {
expect(await accountCodeStorage.getCodeHash(wallet.address)).to.be.eq(EMPTY_STRING_KECCAK);
});

xit('address in the constructor', async () => {
it('address in the constructor', async () => {
await accountCodeStorage
.connect(deployerAccount)
.storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH);
Expand All @@ -162,7 +162,7 @@ describe('AccountCodeStorage tests', function () {
await unsetCodeHash(accountCodeStorage, RANDOM_ADDRESS);
});

xit('constructed code hash', async () => {
it('constructed code hash', async () => {
await accountCodeStorage
.connect(deployerAccount)
.storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH);
Expand All @@ -188,7 +188,7 @@ describe('AccountCodeStorage tests', function () {
expect(await accountCodeStorage.getCodeSize('0x0000000000000000000000000000000000000001')).to.be.eq(0);
});

xit('address in the constructor', async () => {
it('address in the constructor', async () => {
await accountCodeStorage
.connect(deployerAccount)
.storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH);
Expand All @@ -198,7 +198,7 @@ describe('AccountCodeStorage tests', function () {
await unsetCodeHash(accountCodeStorage, RANDOM_ADDRESS);
});

xit('non-zero size', async () => {
it('non-zero size', async () => {
await accountCodeStorage
.connect(deployerAccount)
.storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH);
Expand Down
2 changes: 1 addition & 1 deletion test/ComplexUpgrader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('ComplexUpgrader tests', function () {
).to.be.revertedWith('Can only be called by FORCE_DEPLOYER');
});

xit('successfully upgraded', async () => {
it('successfully upgraded', async () => {
await network.provider.request({
method: 'hardhat_impersonateAccount',
params: [FORCE_DEPLOYER_ADDRESS]
Expand Down
2 changes: 1 addition & 1 deletion test/Compressor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from './shared/constants';
import { deployContract, getCode, getWallets, loadArtifact, setCode } from './shared/utils';

xdescribe('Compressor tests', function () {
describe('Compressor tests', function () {
let wallet: Wallet;
let compressor: Compressor;
let bootloader: ethers.Signer;
Expand Down
2 changes: 1 addition & 1 deletion test/ContractDeployer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from './shared/constants';
import { deployContract, getCode, getWallets, loadArtifact, publishBytecode, setCode } from './shared/utils';

xdescribe('ContractDeployer tests', function () {
describe('ContractDeployer tests', function () {
let wallet: Wallet;
let contractDeployer: ContractDeployer;
let contractDeployerSystemCall: ContractDeployer;
Expand Down
2 changes: 1 addition & 1 deletion test/DefaultAccount.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { signedTxToTransactionData } from './shared/transactions';
import { deployContract, getWallets, loadArtifact, setCode } from './shared/utils';

xdescribe('DefaultAccount tests', function () {
describe('DefaultAccount tests', function () {
let wallet: Wallet;
let account: Wallet;
let defaultAccount: DefaultAccount;
Expand Down
2 changes: 1 addition & 1 deletion test/EventWriter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { EventWriterTest } from '../typechain-types';
import { EVENT_WRITER_CONTRACT_ADDRESS } from './shared/constants';
import { deployContract, getCode, getWallets, setCode } from './shared/utils';

xdescribe('EventWriter tests', function () {
describe('EventWriter tests', function () {
let wallet: Wallet;
let eventWriter: Contract;
let eventWriterTest: EventWriterTest;
Expand Down
2 changes: 1 addition & 1 deletion test/ImmutableSimulator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('ImmutableSimulator tests', function () {
);
});

xit('successfully set', async () => {
it('successfully set', async () => {
await network.provider.request({
method: 'hardhat_impersonateAccount',
params: [DEPLOYER_SYSTEM_CONTRACT_ADDRESS]
Expand Down
2 changes: 1 addition & 1 deletion test/KnownCodesStorage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from './shared/constants';
import { deployContract, getCode, getWallets, loadArtifact, setCode } from './shared/utils';

xdescribe('KnownCodesStorage tests', function () {
describe('KnownCodesStorage tests', function () {
let wallet: Wallet;
let knownCodesStorage: KnownCodesStorage;
let mockL1Messenger: MockL1Messenger;
Expand Down
Loading

0 comments on commit 0d38b70

Please sign in to comment.