Skip to content

Commit

Permalink
Debug CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelleher committed Dec 21, 2023
1 parent e1c52d0 commit a17b6e7
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 13 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ jobs:
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('rust-toolchain.toml') }}
- name: Build all programs
run: cargo build-sbf
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: target
path: target
if-no-files-found: error
retention-days: 1

cargo-test:
needs: cargo-build
Expand Down Expand Up @@ -163,12 +170,18 @@ jobs:
- name: install node_modules
run: yarn --frozen-lockfile

- name: Download build artifacts
- name: Download JS build artifacts
uses: actions/download-artifact@v3
with:
name: dists
path: packages/sdks

- name: Download Rust build artifacts
uses: actions/download-artifact@v3
with:
name: target
path: .

- uses: ./.github/actions/cache-solana
- uses: actions/cache@v3
with:
Expand All @@ -178,7 +191,11 @@ jobs:
target
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('rust-toolchain.toml') }}
- name: run tests
run: yarn test
run: |
ls
ls target
yarn anchor test --skip-build packages/tests/src/functional/beams/core.test.ts
# yarn test
- uses: actions/upload-artifact@v3
if: always()
Expand Down
2 changes: 1 addition & 1 deletion Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cluster = "Localnet"
wallet = "packages/tests/fixtures/provider.json"

[scripts]
test = "echo in $(pwd)"
test = "packages/tests/run.sh"

[test.validator]
slots_per_epoch = "32"
Expand Down
6 changes: 4 additions & 2 deletions packages/sdks/common/src/types/marinade_beam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,8 @@ export type MarinadeBeam = {
{
"name": "vaultAuthorityBump",
"docs": [
"that holds pool tokens(msol in this case)."
"The bump of the PDA that can authorize spending from the vault",
"that holds pool tokens (msol in this case)."
],
"type": "u8"
},
Expand Down Expand Up @@ -1685,7 +1686,8 @@ export const IDL: MarinadeBeam = {
{
"name": "vaultAuthorityBump",
"docs": [
"that holds pool tokens(msol in this case)."
"The bump of the PDA that can authorize spending from the vault",
"that holds pool tokens (msol in this case)."
],
"type": "u8"
},
Expand Down
24 changes: 20 additions & 4 deletions packages/sdks/common/src/types/marinade_lp_beam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export type MarinadeLpBeam = {
{
"name": "liqPoolVault",
"isMut": true,
"isSigner": false
"isSigner": false,
"docs": [
"The token account of the liquidity pool tokens held by the beam."
]
},
{
"name": "vaultAuthority",
Expand Down Expand Up @@ -233,7 +236,12 @@ export type MarinadeLpBeam = {
{
"name": "transferMsolTo",
"isMut": true,
"isSigner": false
"isSigner": false,
"docs": [
"When withdrawing from the Marinade LP, the withdrawal is part SOL, part mSOL.",
"The SOL portion is transferred to the user (withdrawer) and the mSOL portion",
"is transferred to the msol_token_account owned by the marinade stake pool."
]
},
{
"name": "liqPoolSolLegPda",
Expand Down Expand Up @@ -437,7 +445,10 @@ export const IDL: MarinadeLpBeam = {
{
"name": "liqPoolVault",
"isMut": true,
"isSigner": false
"isSigner": false,
"docs": [
"The token account of the liquidity pool tokens held by the beam."
]
},
{
"name": "vaultAuthority",
Expand Down Expand Up @@ -647,7 +658,12 @@ export const IDL: MarinadeLpBeam = {
{
"name": "transferMsolTo",
"isMut": true,
"isSigner": false
"isSigner": false,
"docs": [
"When withdrawing from the Marinade LP, the withdrawal is part SOL, part mSOL.",
"The SOL portion is transferred to the user (withdrawer) and the mSOL portion",
"is transferred to the msol_token_account owned by the marinade stake pool."
]
},
{
"name": "liqPoolSolLegPda",
Expand Down
6 changes: 3 additions & 3 deletions packages/tests/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ find src/functional -name "*.test.ts" | while read test_file; do
yarn anchor test --skip-build packages/tests/$test_file || true
done

yarn -s mochawesome-merge ../../mochawesome-report/mocha-reports/*.json > ../../mochawesome-report/mergedReport.json
yarn marge ../../mochawesome-report/mergedReport.json -o ../../mochawesome-report
yarn tsx src/analyseReport.ts
#yarn -s mochawesome-merge ../../mochawesome-report/mocha-reports/*.json > ../../mochawesome-report/mergedReport.json
#yarn marge ../../mochawesome-report/mergedReport.json -o ../../mochawesome-report
#yarn tsx src/analyseReport.ts
3 changes: 2 additions & 1 deletion packages/tests/run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
echo "test file" $1

report_name="mocha-reports/mocha-report-$(basename "$1" .test.ts).json"

echo "Executing: "
echo "mocha --config packages/tests/.mocharc.json --reporter mochawesome --reporter-options reportFilename=$report_name,quiet=true $1"

mocha --config packages/tests/.mocharc.json --reporter mochawesome --reporter-options reportFilename=$report_name,quiet=true $1
mocha --config packages/tests/.mocharc.json --reporter mochawesome --reporter-options reportFilename=$report_name,quiet=true $1
1 change: 1 addition & 0 deletions tmp.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
echo "in tmp.sh"
echo $PWD

0 comments on commit a17b6e7

Please sign in to comment.