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 all commits
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
50 changes: 50 additions & 0 deletions .github/actions/deps-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Install Dependencies
description: Install non-cargo dependencies in an OS-agnostic way

inputs:
deps:
description: "Dependencies to install (format: ('list' 'of' 'dependencies'))."
required: true
temp:
description: "A temporary directory path that can be used to store the installed binaries if needed."

# NOTE: Don't install binaries in the project directory because the directory might be checked out later.
runs:
using: 'composite'
steps:
- name: Install protoc (Linux)
env:
TMP: ${{ inputs.temp || runner.temp }}
if: runner.os == 'Linux' && contains(inputs.deps, 'protoc')
shell: bash
run: |
wget https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-linux-x86_64.zip
unzip protoc-25.3-linux-x86_64 -d "$TMP/protobuf"
echo "$TMP/protobuf/bin" >> $GITHUB_PATH

- name: Install protoc (MacOS)
env:
TMP: ${{ inputs.temp || runner.temp }}
if: runner.os == 'macOS' && contains(inputs.deps, 'protoc')
shell: bash
run: |
wget https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-osx-x86_64.zip
unzip protoc-25.3-osx-x86_64.zip -d "$TMP/protobuf"
echo "$TMP/protobuf/bin" >> $GITHUB_PATH

- name: Install protoc (Windows)
env:
TMP: ${{ inputs.temp || runner.temp }}
if: runner.os == 'Windows' && contains(inputs.deps, 'protoc')
shell: powershell
run: |
Invoke-WebRequest -Uri https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-win64.zip -OutFile protoc-25.3-win64.zip
7z x protoc-25.3-win64.zip -o"$TMP\protobuf"
echo "$TMP\protobuf\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Install libudev (Linux)
if: runner.os == 'Linux' && contains(inputs.deps, 'libudev')
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y libudev-dev
77 changes: 5 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,87 +19,19 @@ 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

- name: Start checking code format and lint
continue-on-error: true
run: |
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
44 changes: 42 additions & 2 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
rustup default nightly-2022-10-29

- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')

- 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
Expand Down Expand Up @@ -95,6 +100,11 @@ jobs:
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
rustup default nightly-2022-10-29

- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')

- 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
Expand Down Expand Up @@ -145,6 +155,11 @@ jobs:
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
rustup default nightly-2022-10-29

- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')

- 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 }})" >> $Env:GITHUB_ENV
Expand Down Expand Up @@ -197,6 +212,11 @@ jobs:
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
rustup default nightly-2022-10-29

- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')

- 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
Expand Down Expand Up @@ -252,6 +272,11 @@ jobs:
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH

- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')

- name: Install toolchain
run: |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
Expand Down Expand Up @@ -312,6 +337,11 @@ jobs:
rustup default nightly-2022-10-29
rustup target add aarch64-apple-ios

- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')

- 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
Expand Down Expand Up @@ -373,6 +403,11 @@ jobs:
rustup default nightly-2022-10-29
rustup target add aarch64-linux-android

- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')

- name: Setup NDK
run: ./scripts/ci/android-ndk.sh x86 23

Expand Down Expand Up @@ -402,7 +437,7 @@ jobs:
run: |
NAME="mm2_$COMMIT_HASH-android-aarch64.zip"
mv target/aarch64-linux-android/release/libmm2lib.a target/aarch64-linux-android/release/libmm2.a
zip $NAME target/aarch64-linux-android/release/libmm2.a -j
zip $NAME target/aarch64-linux-android/release/libmm2.a -j
mkdir $BRANCH_NAME
mv $NAME ./$BRANCH_NAME/

Expand Down Expand Up @@ -439,6 +474,11 @@ jobs:
rustup default nightly-2022-10-29
rustup target add armv7-linux-androideabi

- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')

- name: Setup NDK
run: ./scripts/ci/android-ndk.sh x86 23

Expand Down Expand Up @@ -468,7 +508,7 @@ jobs:
run: |
NAME="mm2_$COMMIT_HASH-android-armv7.zip"
mv target/armv7-linux-androideabi/release/libmm2lib.a target/armv7-linux-androideabi/release/libmm2.a
zip $NAME target/armv7-linux-androideabi/release/libmm2.a -j
zip $NAME target/armv7-linux-androideabi/release/libmm2.a -j
mkdir $BRANCH_NAME
mv $NAME ./$BRANCH_NAME/

Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/fmt-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,38 @@ concurrency:

jobs:
fmt-and-lint:
name: x86 Format and Lint Checks
timeout-minutes: 45
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3

- name: Install toolchain
run: |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal --component rustfmt clippy
rustup default nightly-2022-10-29

- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get -y install libudev-dev
if: matrix.os == 'ubuntu-latest'
- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc' 'libudev-dev')

- 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: Wasm Lint Checks
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
Expand All @@ -45,8 +49,13 @@ jobs:
rustup default nightly-2022-10-29
rustup target add wasm32-unknown-unknown

- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')

- 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
Loading
Loading