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

BACK-1332: run tests on GH Actions CI #535

Closed
wants to merge 78 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
5a57729
BACK-1332: run tests on GH Actions CI
aburkut Oct 19, 2023
59927b9
adjust tests command in ci config
aburkut Oct 19, 2023
7142c70
debug
aburkut Oct 19, 2023
968e573
trigger builds
aburkut Oct 19, 2023
566aafe
run test on ci
aburkut Oct 19, 2023
3a3f9fe
update ci config
aburkut Oct 19, 2023
9f61df4
update
aburkut Oct 19, 2023
4faddfb
debug tests on ci
aburkut Oct 20, 2023
0ecaabe
update ci config
aburkut Oct 20, 2023
9b933c7
update ci config
aburkut Oct 20, 2023
addf0fb
debug ci context
aburkut Oct 20, 2023
8da6810
debug ci context
aburkut Oct 20, 2023
39fee05
debug ci
aburkut Oct 20, 2023
8bff1f0
debug ci
aburkut Oct 20, 2023
603ea82
debug ci
aburkut Oct 20, 2023
de3d37a
debug ci
aburkut Oct 20, 2023
adf5398
debug ci
aburkut Oct 20, 2023
d8eb0fd
debug ci
aburkut Oct 20, 2023
a2e378d
debug ci
aburkut Oct 20, 2023
95c3986
debug ci
aburkut Oct 20, 2023
3e5d415
debug ci
aburkut Oct 20, 2023
981d669
debug ci
aburkut Oct 20, 2023
0596e68
debug ci
aburkut Oct 20, 2023
4dd1a93
debug ci
aburkut Oct 20, 2023
a7191ac
debug ci
aburkut Oct 20, 2023
6295b9b
debug ci
aburkut Oct 20, 2023
0e0b8a0
debug ci
aburkut Oct 20, 2023
de5c760
remove npm script
aburkut Oct 20, 2023
0e526c6
update tests
aburkut Oct 20, 2023
f31fafa
update ci config
aburkut Oct 20, 2023
8f95dd5
update ci config
aburkut Oct 20, 2023
a156bf2
Merge branch 'master' into aburkut/back-1332-tests-ci
aburkut Oct 23, 2023
92e969b
add timeout for tests
aburkut Oct 23, 2023
f1cf0d2
fix jest detect open handles
aburkut Oct 23, 2023
160d57d
Merge branch 'master' into aburkut/back-1332-tests-ci
aburkut Oct 24, 2023
ef47bc6
add --forceExit option for jjest tests
aburkut Oct 24, 2023
bd23fc8
update
aburkut Oct 24, 2023
61879d1
update
aburkut Oct 24, 2023
67cd643
update
aburkut Oct 24, 2023
fbcef53
update
aburkut Oct 24, 2023
1ddede9
update
aburkut Oct 24, 2023
0174f3a
no changed tests
aburkut Oct 24, 2023
c527e23
Merge branch 'master' into aburkut/back-1332-tests-ci
aburkut Oct 24, 2023
bb67cb5
update
aburkut Oct 24, 2023
a96f006
update
aburkut Oct 24, 2023
5dbdbf2
update
aburkut Oct 24, 2023
417fd9c
update
aburkut Oct 24, 2023
d410c6b
debug
aburkut Oct 25, 2023
5676341
debug
aburkut Oct 25, 2023
810ec64
debug
aburkut Oct 25, 2023
c4e5c62
debug
aburkut Oct 25, 2023
387ac6f
debug
aburkut Oct 25, 2023
cf4d3c5
debug
aburkut Oct 25, 2023
3ab4dc0
debug
aburkut Oct 25, 2023
6ddbd82
debug
aburkut Oct 27, 2023
a11f90a
debug
aburkut Oct 27, 2023
248b245
debug
aburkut Oct 27, 2023
c21f66b
debug
aburkut Oct 27, 2023
097aee1
debug
aburkut Oct 27, 2023
00f3ceb
debug
aburkut Oct 27, 2023
4ef797f
debug
aburkut Oct 27, 2023
da989ce
debug
aburkut Oct 27, 2023
40c8b01
debug
aburkut Oct 27, 2023
ebd7c42
debug
aburkut Oct 27, 2023
5c61f1c
debug
aburkut Oct 27, 2023
f5313bf
debug
aburkut Oct 27, 2023
6f4c687
debug
aburkut Oct 27, 2023
7dc1be7
debug
aburkut Oct 27, 2023
222590b
debug
aburkut Oct 27, 2023
3ce8495
debug
aburkut Oct 27, 2023
221e8cc
debug
aburkut Oct 27, 2023
2c0e5a8
Merge branch 'master' into aburkut/back-1332-tests-ci
aburkut Oct 27, 2023
c40d039
debug
aburkut Oct 27, 2023
bd5979d
debug
aburkut Oct 30, 2023
84334eb
debug
aburkut Oct 30, 2023
4fc44f2
debug
aburkut Nov 2, 2023
8454d9e
debug
aburkut Nov 2, 2023
57588db
Merge branch 'master' into aburkut/back-1332-tests-ci
aburkut Nov 2, 2023
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
48 changes: 39 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,52 @@
name: CI
on: push
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16.x']
name: Node ${{ matrix.node }} sample
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
- name: Git checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
node-version: ${{ matrix.node }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7
with:
node-version: 16

- name: Install Dependencies
run: yarn

- name: Run Eslint checks
if: github.event_name == 'push'
run: yarn check:es

- name: Run Changed tests only
if: github.event_name == 'pull_request'
timeout-minutes: 15
env:
TENDERLY_ACCOUNT_ID: ${{ secrets.TENDERLY_USERNAME }}
TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }}
TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }}
HTTP_PROVIDER_1: ${{ secrets.HTTP_PROVIDER_1 }}
HTTP_PROVIDER_10: ${{ secrets.HTTP_PROVIDER_10 }}
HTTP_PROVIDER_56: ${{ secrets.HTTP_PROVIDER_56 }}
HTTP_PROVIDER_137: ${{ secrets.HTTP_PROVIDER_137 }}
HTTP_PROVIDER_250: ${{ secrets.HTTP_PROVIDER_250 }}
HTTP_PROVIDER_1101: ${{ secrets.HTTP_PROVIDER_1101 }}
HTTP_PROVIDER_8453: ${{ secrets.HTTP_PROVIDER_8453 }}
HTTP_PROVIDER_42161: ${{ secrets.HTTP_PROVIDER_42161 }}
HTTP_PROVIDER_43114: ${{ secrets.HTTP_PROVIDER_43114 }}
run: |
CHANGED_TESTS=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} | grep test.ts || true)
echo "$CHANGED_TESTS"
if [ -n "$CHANGED_TESTS" ]; then
echo "Running the following changed specs"
npx jest --ci --forceExit --verbose $CHANGED_TESTS
else
echo "There are no changed tests...skipping"
fi

printf '%s\n' "$TENDERLY_PROJECT" > test.txt
cat test.txt
10 changes: 10 additions & 0 deletions src/dex/balancer-v2/new.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import dotenv from 'dotenv';
dotenv.config();


describe('Test', () => {
it('should pass', () => {
console.log(process.env.TENDERLY_PROJECT);
expect(true).toBe(true);
})
});
1 change: 1 addition & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
3 changes: 3 additions & 0 deletions tests/tenderly-simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export class TenderlySimulation implements TransactionSimulator {
}

try {
await process.nextTick(() => { }); // https://stackoverflow.com/questions/69169492/async-external-function-leaves-open-handles-jest-supertest-express
let res = await axios.post(
`https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_ID}/project/${TENDERLY_PROJECT}/fork`,
{
Expand Down Expand Up @@ -109,6 +110,7 @@ export class TenderlySimulation implements TransactionSimulator {
};
try {
if (stateOverrides) {
await process.nextTick(() => { }); // https://stackoverflow.com/questions/69169492/async-external-function-leaves-open-handles-jest-supertest-express
const result = await axios.post(
`
https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_ID}/project/${TENDERLY_PROJECT}/contracts/encode-states`,
Expand All @@ -133,6 +135,7 @@ export class TenderlySimulation implements TransactionSimulator {
);
}

await process.nextTick(() => { }); // https://stackoverflow.com/questions/69169492/async-external-function-leaves-open-handles-jest-supertest-express
const { data } = await axios.post(
`https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_ID}/project/${TENDERLY_PROJECT}/fork/${this.forkId}/simulate`,
_params,
Expand Down