Skip to content

Commit

Permalink
test: reorganize ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff-CCH committed Jan 11, 2024
1 parent 3229a25 commit e6a07e8
Show file tree
Hide file tree
Showing 52 changed files with 142 additions and 53 deletions.
5 changes: 5 additions & 0 deletions .changeset/khaki-pillows-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/logics': patch
---

reorganize ci
3 changes: 3 additions & 0 deletions .env.mainnet.pb1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CHAIN_ID=1
HTTP_RPC_URL=https://eth.llamarpc.com
BLOCK_NUMBER=18965855
3 changes: 3 additions & 0 deletions .env.mainnet.pb2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CHAIN_ID=1
HTTP_RPC_URL=https://eth.llamarpc.com
BLOCK_NUMBER=18973300
3 changes: 3 additions & 0 deletions .env.mainnet.pb3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CHAIN_ID=1
HTTP_RPC_URL=https://eth.llamarpc.com
BLOCK_NUMBER=18981936
2 changes: 0 additions & 2 deletions .env.polygon

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
run-e2e-test:
name: Run e2e test
name: latest
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -21,4 +21,4 @@ jobs:
run: yarn install

- name: Run e2e test
run: yarn test:e2e
run: yarn test:e2e:latest
24 changes: 24 additions & 0 deletions .github/workflows/e2e-test-mainnet-pb1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: E2E Test

on:
push:
pull_request:

jobs:
run-e2e-test:
name: mainnet pb1
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: yarn install

- name: Run e2e test
run: yarn test:e2e:mainnet:pb1
24 changes: 24 additions & 0 deletions .github/workflows/e2e-test-mainnet-pb2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: E2E Test

on:
push:
pull_request:

jobs:
run-e2e-test:
name: mainnet pb2
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: yarn install

- name: Run e2e test
run: yarn test:e2e:mainnet:pb2
24 changes: 24 additions & 0 deletions .github/workflows/e2e-test-mainnet-pb3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: E2E Test

on:
push:
pull_request:

jobs:
run-e2e-test:
name: mainnet pb3
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: yarn install

- name: Run e2e test
run: yarn test:e2e:mainnet:pb3
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
"lint": "eslint --fix src",
"prepublishOnly": "yarn build",
"test": "mocha",
"test:e2e": "yarn run test:e2e:mainnet && yarn run test:e2e:polygon && yarn run test:e2e:metis && yarn run test:e2e:arbitrum",
"test:e2e:mainnet": "env-cmd -f .env.mainnet hardhat test --grep 'mainnet'",
"test:e2e:polygon": "env-cmd -f .env.polygon hardhat test --grep 'polygon'",
"test:e2e:metis": "env-cmd -f .env.metis hardhat test --grep 'metis'",
"test:e2e:arbitrum": "env-cmd -f .env.arbitrum hardhat test --grep 'arbitrum'",
"test:e2e:latest": "yarn run test:e2e:mainnet && yarn run test:e2e:metis && yarn run test:e2e:arbitrum",
"test:e2e:mainnet": "env-cmd -f .env.mainnet hardhat test --grep 'mainnet:'",
"test:e2e:mainnet:pb1": "env-cmd -f .env.mainnet.pb1 hardhat test --grep 'mainnet-pb1:'",
"test:e2e:mainnet:pb2": "env-cmd -f .env.mainnet.pb2 hardhat test --grep 'mainnet-pb2:'",
"test:e2e:mainnet:pb3": "env-cmd -f .env.mainnet.pb3 hardhat test --grep 'mainnet-pb3:'",
"test:e2e:metis": "env-cmd -f .env.metis hardhat test --grep 'metis:'",
"test:e2e:arbitrum": "env-cmd -f .env.arbitrum hardhat test --grep 'arbitrum:'",
"test:unit": "mocha --recursive src"
},
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion test/init.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as common from '@protocolink/common';

common.setNetwork(common.ChainId.mainnet, { rpcUrl: 'https://eth.llamarpc.com' });
common.setNetwork(common.ChainId.goerli, { rpcUrl: 'https://rpc.ankr.com/eth_goerli' });
2 changes: 1 addition & 1 deletion test/logics/aave-v2/borrow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect } from 'chai';
import * as helpers from './helpers';
import hre from 'hardhat';

describe('mainnet: Test AaveV2 Borrow Logic', function () {
describe('mainnet-pb1: Test AaveV2 Borrow Logic', function () {
let chainId: number;
let users: SignerWithAddress[];

Expand Down
2 changes: 1 addition & 1 deletion test/logics/aave-v2/deposit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect } from 'chai';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test AaveV2 Deposit Logic', function () {
describe('mainnet-pb1: Test AaveV2 Deposit Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/aave-v2/flash-loan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import hre from 'hardhat';
import * as utility from 'src/logics/utility';
import * as utils from 'test/utils';

describe('mainnet: Test AaveV2 FlashLoan Logic', function () {
describe('mainnet-pb1: Test AaveV2 FlashLoan Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/aave-v2/repay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as helpers from './helpers';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test AaveV2 Repay Logic', function () {
describe('mainnet-pb1: Test AaveV2 Repay Logic', function () {
let chainId: number;
let users: SignerWithAddress[];

Expand Down
3 changes: 2 additions & 1 deletion test/logics/aave-v2/withdraw.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as helpers from './helpers';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test AaveV2 Withdraw Logic', function () {
describe('mainnet-pb1: Test AaveV2 Withdraw Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand All @@ -31,6 +31,7 @@ describe('mainnet: Test AaveV2 Withdraw Logic', function () {
tokenOut: aavev2.mainnetTokens.WETH,
},
{
// TOOD: AssertionError: Expected transaction NOT to be reverted, but it reverted with reason '5'
input: new common.TokenAmount(aavev2.mainnetTokens.aUSDC, '1'),
tokenOut: aavev2.mainnetTokens.USDC,
},
Expand Down
2 changes: 1 addition & 1 deletion test/logics/aave-v3/borrow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect } from 'chai';
import * as helpers from './helpers';
import hre from 'hardhat';

describe('mainnet: Test AaveV3 Borrow Logic', function () {
describe('mainnet-pb1: Test AaveV3 Borrow Logic', function () {
let chainId: number;
let users: SignerWithAddress[];

Expand Down
2 changes: 1 addition & 1 deletion test/logics/aave-v3/flash-loan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import hre from 'hardhat';
import * as utility from 'src/logics/utility';
import * as utils from 'test/utils';

describe('mainnet: Test AaveV3 FlashLoan Logic', function () {
describe('mainnet-pb1: Test AaveV3 FlashLoan Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/aave-v3/repay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as helpers from './helpers';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test AaveV3 Repay Logic', function () {
describe('mainnet-pb1: Test AaveV3 Repay Logic', function () {
let chainId: number;
let users: SignerWithAddress[];

Expand Down
2 changes: 1 addition & 1 deletion test/logics/aave-v3/supply.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect } from 'chai';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test AaveV3 Supply Logic', function () {
describe('mainnet-pb1: Test AaveV3 Supply Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/aave-v3/withdraw.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as helpers from './helpers';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test AaveV3 Withdraw Logic', function () {
describe('mainnet-pb1: Test AaveV3 Withdraw Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/balancer-v2/flash-loan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import hre from 'hardhat';
import * as utility from 'src/logics/utility';
import * as utils from 'test/utils';

describe('mainnet: Test BalancerV2 FlashLoan Logic', function () {
describe('mainnet-pb1: Test BalancerV2 FlashLoan Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/compound-v2/claim.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as helpers from './helpers';
import hre from 'hardhat';
import * as hrehelpers from '@nomicfoundation/hardhat-network-helpers';

describe('mainnet: Test CompoundV2 Claim Logic', function () {
describe('mainnet-pb1: Test CompoundV2 Claim Logic', function () {
let chainId: number;
let users: SignerWithAddress[];

Expand Down
2 changes: 1 addition & 1 deletion test/logics/compound-v2/repay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import hre from 'hardhat';
import * as hrehelpers from '@nomicfoundation/hardhat-network-helpers';
import * as utils from 'test/utils';

describe('mainnet: Test CompoundV2 Repay Logic', function () {
describe('mainnet-pb1: Test CompoundV2 Repay Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/compound-v2/supply.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect } from 'chai';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test CompoundV2 Supply Logic', function () {
describe('mainnet-pb1: Test CompoundV2 Supply Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/compound-v2/withdraw.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as helpers from './helpers';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test CompoundV2 Withdraw Logic', function () {
describe('mainnet-pb1: Test CompoundV2 Withdraw Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/compound-v3/borrow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect } from 'chai';
import * as helpers from './helpers';
import hre from 'hardhat';

describe('mainnet: Test CompoundV3 Borrow Logic', function () {
describe('mainnet-pb1: Test CompoundV3 Borrow Logic', function () {
let chainId: number;
let user: SignerWithAddress;
let routerKit: core.RouterKit;
Expand Down
2 changes: 1 addition & 1 deletion test/logics/compound-v3/claim.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as helpers from './helpers';
import hre from 'hardhat';
import * as hrehelpers from '@nomicfoundation/hardhat-network-helpers';

describe('mainnet: Test CompoundV3 Claim Logic', function () {
describe('mainnet-pb1: Test CompoundV3 Claim Logic', function () {
let chainId: number;
let users: SignerWithAddress[];
let service: compoundv3.Service;
Expand Down
2 changes: 1 addition & 1 deletion test/logics/compound-v3/repay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as helpers from './helpers';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test CompoundV3 Repay Logic', function () {
describe('mainnet-pb1: Test CompoundV3 Repay Logic', function () {
let chainId: number;
let users: SignerWithAddress[];
let service: compoundv3.Service;
Expand Down
2 changes: 1 addition & 1 deletion test/logics/compound-v3/supply-base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect } from 'chai';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test CompoundV3 SupplyBase Logic', function () {
describe('mainnet-pb1: Test CompoundV3 SupplyBase Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/compound-v3/supply-collateral.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect } from 'chai';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test CompoundV3 SupplyCollateral Logic', function () {
describe('mainnet-pb1: Test CompoundV3 SupplyCollateral Logic', function () {
let chainId: number;
let user: SignerWithAddress;
let service: compoundv3.Service;
Expand Down
2 changes: 1 addition & 1 deletion test/logics/compound-v3/withdraw-base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as helpers from './helpers';
import hre from 'hardhat';
import * as utils from 'test/utils';

describe('mainnet: Test CompoundV3 WithdrawBase Logic', function () {
describe('mainnet-pb1: Test CompoundV3 WithdrawBase Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/compound-v3/withdraw-collateral.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect } from 'chai';
import * as helpers from './helpers';
import hre from 'hardhat';

describe('mainnet: Test CompoundV3 WithdrawCollateral Logic', function () {
describe('mainnet-pb1: Test CompoundV3 WithdrawCollateral Logic', function () {
let chainId: number;
let user: SignerWithAddress;
let routerKit: core.RouterKit;
Expand Down
2 changes: 1 addition & 1 deletion test/logics/morphoblue/borrow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as helpers from './helpers';
import hre from 'hardhat';
import * as morphoblue from 'src/logics/morphoblue';

describe('mainnet: Test Morphoblue Borrow Logic', function () {
describe('mainnet-pb2: Test Morphoblue Borrow Logic', function () {
let chainId: number;
let user: SignerWithAddress;
let service: morphoblue.Service;
Expand Down
2 changes: 1 addition & 1 deletion test/logics/morphoblue/flash-loan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as morphoblue from 'src/logics/morphoblue';
import * as utility from 'src/logics/utility';
import * as utils from 'test/utils';

describe('mainnet: Test Morphoblue FlashLoan Logic', function () {
describe('mainnet-pb2: Test Morphoblue FlashLoan Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
2 changes: 1 addition & 1 deletion test/logics/morphoblue/repay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import hre from 'hardhat';
import * as morphoblue from 'src/logics/morphoblue';
import * as utils from 'test/utils';

describe('mainnet: Test Morphoblue Borrow Logic', function () {
describe('mainnet-pb2: Test Morphoblue Borrow Logic', function () {
let chainId: number;
let users: SignerWithAddress[];
let service: morphoblue.Service;
Expand Down
2 changes: 1 addition & 1 deletion test/logics/morphoblue/supply-collateral.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import hre from 'hardhat';
import * as morphoblue from 'src/logics/morphoblue';
import * as utils from 'test/utils';

describe('mainnet: Test Morphoblue SupplyCollateral Logic', function () {
describe('mainnet-pb2: Test Morphoblue SupplyCollateral Logic', function () {
let chainId: number;
let user: SignerWithAddress;
let service: morphoblue.Service;
Expand Down
2 changes: 1 addition & 1 deletion test/logics/morphoblue/supply.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import hre from 'hardhat';
import * as morphoblue from 'src/logics/morphoblue';
import * as utils from 'test/utils';

describe('mainnet: Test Morphoblue Supply Logic', function () {
describe('mainnet-pb2: Test Morphoblue Supply Logic', function () {
let chainId: number;
let user: SignerWithAddress;
let service: morphoblue.Service;
Expand Down
2 changes: 1 addition & 1 deletion test/logics/morphoblue/withdraw-collateral.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as helpers from './helpers';
import hre from 'hardhat';
import * as morphoblue from 'src/logics/morphoblue';

describe('mainnet: Test Morphoblue Withdraw Collateral Logic', function () {
describe('mainnet-pb2: Test Morphoblue Withdraw Collateral Logic', function () {
let chainId: number;
let user: SignerWithAddress;

Expand Down
Loading

0 comments on commit e6a07e8

Please sign in to comment.