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

fix(tests): fix failing tests #2085

Merged
merged 54 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
9ec3c76
CI improvments
mariocynicys Feb 28, 2024
a49235a
replace rick and morty with doc and marty
mariocynicys Feb 28, 2024
74033f3
follow redirect for test process price request
mariocynicys Feb 28, 2024
b41f67d
Refactor the eth tests
mariocynicys Mar 7, 2024
3a32372
WIP: upgrading tendermint
mariocynicys Mar 8, 2024
611aee4
finish upgrading tendermint
mariocynicys Mar 11, 2024
9ff94d4
fix fmt & lint issues
mariocynicys Mar 11, 2024
19e2a09
install protopuf compiler (used in builds)
mariocynicys Mar 11, 2024
9deace2
refactor names + added some test atoms to the test address + fix depr…
mariocynicys Mar 12, 2024
2b82e4b
update outdated IBC channels
mariocynicys Mar 13, 2024
6873cce
refactor ci actions
mariocynicys Mar 13, 2024
f11d4ec
fix wasm builds
mariocynicys Mar 14, 2024
0b7ece0
ignore failing tests for now
mariocynicys Mar 14, 2024
094a5d9
fix 2 more failing tests after rebase with dev
mariocynicys Mar 14, 2024
053567c
add cargo lock
mariocynicys Mar 14, 2024
24015b0
fix nonce locking issue
mariocynicys Mar 15, 2024
63ffcc7
use different address for `test_nonce_several_urls`
mariocynicys Mar 15, 2024
16331e8
don't use sepolia since it returns the highest nonce and rules out ou…
mariocynicys Mar 15, 2024
5366bb4
move eth chain interactive tests to docker tests
mariocynicys Mar 16, 2024
a4e115a
unignore test_hd_utxo_tx_history tests
mariocynicys Mar 16, 2024
2be05b6
move mm2 integration tests that used JST (erc20 token for tests) to d…
mariocynicys Mar 19, 2024
dec31f9
move test_orderbook_depth tests to dockerized tests
mariocynicys Mar 19, 2024
23437a2
configure loopback address on macos on CI
mariocynicys Mar 19, 2024
8bc8853
fix formatting issue
mariocynicys Mar 19, 2024
8d5a445
fix `test_search_for_swap_tx_spent_electrum_was_[spent|refunded]`
mariocynicys Mar 22, 2024
beb4410
fix test lint issue
mariocynicys Mar 23, 2024
aa1fbe6
fix nft test unwraps None
mariocynicys Mar 26, 2024
8cc6afd
rename macos-ifconfig script to lo0_config
mariocynicys Mar 26, 2024
27ca6a0
bump un-bumped prost versions
mariocynicys Apr 3, 2024
e5a12b1
move qrc20_tests::test_send_taker_fee to docker
mariocynicys Apr 3, 2024
2e141de
suggestions from onur and fixing fixmes
mariocynicys Apr 3, 2024
ca4837d
fix nft moralis block num and ignore tendermint ibc test
mariocynicys Apr 3, 2024
73ca142
unignore swap_iris_with_rick & swap_usdc_ibc_with_nimda tendermint tests
mariocynicys Apr 9, 2024
5fa2259
revert using a global env variable for checking server availablity
mariocynicys Apr 9, 2024
07f46ca
change format and lint jobs' names
mariocynicys Apr 9, 2024
a39faa4
try unwrap_err instead of expect_err
mariocynicys Apr 9, 2024
c64196d
Revert "try unwrap_err instead of expect_err"
mariocynicys Apr 9, 2024
4f8d1f3
ignore test_websocket_invalid_url for now
mariocynicys Apr 9, 2024
319b63a
ignore doesn't work with wasm tests, so commenting it out
mariocynicys Apr 9, 2024
978434b
upgrade some *rustls crates to reduce duplications
mariocynicys Apr 11, 2024
f739233
suggestions from omar: remove eth dist + add qick test
mariocynicys Apr 11, 2024
6311e77
fix adex-cli compliation issues due to hyper-rustls & rustls verions
mariocynicys Apr 12, 2024
d4e512a
suggestions from omar: unignore ignored tests
mariocynicys Apr 12, 2024
d80a0db
fix ordermathcing tests and eth_with_tokens tests
mariocynicys Apr 12, 2024
dcc3a49
fix best order tests
mariocynicys Apr 12, 2024
440ef67
fix two tests were using eth with no balance
mariocynicys Apr 12, 2024
729be0f
suggestions from omar: fix wasm compilation issue by using futures-ru…
mariocynicys Apr 13, 2024
9577388
suggestions from omar: provide a default value for price_sources by m…
mariocynicys Apr 13, 2024
2f87629
remove note around using servername isntead of dnsnameref
mariocynicys Apr 13, 2024
8e7bafc
use log in tests instead of println
mariocynicys Apr 13, 2024
809f5f5
revert some test helper funcs
mariocynicys Apr 13, 2024
eda0f42
use wait_check_stats_swap_status to avoid frequent taker swap stat no…
mariocynicys Apr 13, 2024
e76b92e
quit conneciton_loop if socket_addr or dns_name parsing fails
mariocynicys Apr 13, 2024
dd2c7b3
accept only domain names (no ips) for ssl enabled electrum servers
mariocynicys Apr 13, 2024
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
Next Next commit
CI improvments
Remove unused code/steps
Merge jobs that could be merged together (e.g. jobs used for building could be used for testing afterwards)
Give the jobs nicer `name`s so they don't appear like `some-job` on github UI
  • Loading branch information
mariocynicys committed Apr 13, 2024
commit 9ec3c76cd2ab41b2e75974a27d9adf00a5a2b6b8
76 changes: 4 additions & 72 deletions .github/workflows/adex-cli.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: adex-cli
name: Adex CLI
on: [push]

concurrency:
Expand All @@ -10,6 +10,7 @@ env:

jobs:
code-check:
name: Code Checks
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -18,21 +19,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH

- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV

- name: Calculate commit hash for merge commit
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache

Expand All @@ -41,64 +27,10 @@ jobs:
cargo fmt --manifest-path ./mm2src/adex_cli/Cargo.toml --all -- --check
cargo clippy --manifest-path ./mm2src/adex_cli/Cargo.toml --all-targets --all-features -- --D warnings

test:
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3

- name: pre scripts for ci container
- name: Start building
run: |
git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH

- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV

- name: Calculate commit hash for merge commit
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
cargo build --manifest-path ./mm2src/adex_cli/Cargo.toml

- name: Start testing
run: |
cargo test --manifest-path ./mm2src/adex_cli/Cargo.toml --no-fail-fast

build:
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3

- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH

- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV

- name: Calculate commit hash for merge commit
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
onur-ozkan marked this conversation as resolved.
Show resolved Hide resolved

- name: Start building
run: |
cargo build --manifest-path ./mm2src/adex_cli/Cargo.toml
9 changes: 3 additions & 6 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
MANUAL_MM_VERSION: true
JEMALLOC_SYS_WITH_MALLOC_CONF: "background_thread:true,narenas:1,tcache:false,dirty_decay_ms:0,muzzy_decay_ms:0,metadata_thp:auto"
FILE_SERVER_AVAILABLE: ${{ secrets.FILE_SERVER_KEY != '' }}

jobs:
linux-x86-64:
Expand Down Expand Up @@ -51,19 +52,15 @@ jobs:
cargo build --bin mm2 --release

- name: Compress build output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
if: env.FILE_SERVER_AVAILABLE
run: |
NAME="mm2_$COMMIT_HASH-linux-x86-64.zip"
zip $NAME target/release/mm2 -j
mkdir $BRANCH_NAME
mv $NAME ./$BRANCH_NAME/

- name: Upload output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
if: env.FILE_SERVER_AVAILABLE
uses: garygrossgarten/github-action-scp@v0.8.0
with:
host: ${{ secrets.FILE_SERVER_HOST }}
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/fmt-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ concurrency:

jobs:
fmt-and-lint:
name: Style Checks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this title isn't correct, we lint the code from many aspects which isn't all about styles

Suggested change
name: Style Checks
name: X86 Format and Lint Check

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might wanna omit and X86 part tho. and also have wasm with the same name.
I think this makes the workflow looks more organized:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem is we do have cross compilation pipelines (armv7, aarch64, x86, wasm, etc.) that's why I prefer explicitly adding targets in the pipeline names.

timeout-minutes: 45
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -20,21 +21,24 @@ jobs:
rustup default nightly-2022-10-29

- name: Install OS dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get -y install libudev-dev
if: matrix.os == 'ubuntu-latest'

- name: Cargo cache
uses: ./.github/actions/cargo-cache

- name: fmt check
# Format checks aren't OS dependant.
if: matrix.os == 'ubuntu-latest'
run: cargo fmt -- --check

- name: x86-64 code lint
- name: clippy lint
run: cargo clippy --all-targets --all-features -- --D warnings

wasm-lint:
name: Style Checks
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
Expand All @@ -48,5 +52,5 @@ jobs:
- name: Cargo cache
uses: ./.github/actions/cargo-cache

- name: wasm code lint
- name: clippy lint
run: cargo clippy --target wasm32-unknown-unknown -- --D warnings
12 changes: 5 additions & 7 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "PR Lint"
name: PR Lint

on:
pull_request:
Expand Down Expand Up @@ -45,11 +45,9 @@ jobs:
fi

- name: Check PR labels
if: >
(contains(toJson(github.event.pull_request.labels.*.name), 'under review') == false &&
contains(toJson(github.event.pull_request.labels.*.name), 'in progress') == false) ||
(contains(toJson(github.event.pull_request.labels.*.name), 'under review') == true &&
contains(toJson(github.event.pull_request.labels.*.name), 'in progress') == true)
env:
LABEL_NAMES: ${{ toJson(github.event.pull_request.labels.*.name) }}
if: contains(env.LABEL_NAMES, 'under review') == contains(env.LABEL_NAMES, 'in progress')
run: |
echo "PR must have "exactly one" of these labels: [ 'under review', 'in progress' ]."
echo "PR must have "exactly one" of these labels: ['under review', 'in progress']."
exit 1
48 changes: 26 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Test
on: [push]
on:
push:
branches-ignore:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -121,27 +124,28 @@ jobs:
wget -O - https://raw.githubusercontent.com/KomodoPlatform/komodo/master/zcutil/fetch-params-alt.sh | bash
cargo test --test 'mm2_tests_main' --no-fail-fast

# https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits
# https://github.com/KomodoPlatform/atomicDEX-API/actions/runs/4419618128/jobs/7748266141#step:4:1790
# mac-x86-64-mm2-integration:
# timeout-minutes: 90
# runs-on: macos-latest
# env:
# BOB_PASSPHRASE: ${{ secrets.BOB_PASSPHRASE_MACOS }}
# BOB_USERPASS: ${{ secrets.BOB_USERPASS_MACOS }}
# ALICE_PASSPHRASE: ${{ secrets.ALICE_PASSPHRASE_MACOS }}
# ALICE_USERPASS: ${{ secrets.ALICE_USERPASS_MACOS }}
# TELEGRAM_API_KEY: ${{ secrets.TELEGRAM_API_KEY }}
# steps:
# - uses: actions/checkout@v3
# - name: Install toolchain
# run: |
# rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
# rustup default nightly-2022-10-29
# rustup target add x86_64-apple-darwin

# - name: Test
# run: cargo test --test 'mm2_tests_main' --target x86_64-apple-darwin
mac-x86-64-mm2-integration:
timeout-minutes: 90
runs-on: macos-latest
env:
BOB_PASSPHRASE: ${{ secrets.BOB_PASSPHRASE_MACOS }}
BOB_USERPASS: ${{ secrets.BOB_USERPASS_MACOS }}
ALICE_PASSPHRASE: ${{ secrets.ALICE_PASSPHRASE_MACOS }}
ALICE_USERPASS: ${{ secrets.ALICE_USERPASS_MACOS }}
TELEGRAM_API_KEY: ${{ secrets.TELEGRAM_API_KEY }}
steps:
- uses: actions/checkout@v3
- name: Install toolchain
run: |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
rustup default nightly-2022-10-29
rustup target add x86_64-apple-darwin

- name: Cargo cache
uses: ./.github/actions/cargo-cache

- name: Test
run: cargo test --test 'mm2_tests_main' --no-fail-fast --target x86_64-apple-darwin

win-x86-64-mm2-integration:
timeout-minutes: 90
Expand Down