near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.31k stars 605 forks source link

debug(nayduck) - adding debug logs to the near test contracts build.rs #11738

Closed wacban closed 1 week ago

wacban commented 1 week ago

The slow chunk test in nayduck is still failing due to the test contract being built without the test_features. In my previous attempt it worked once, likely only because I made changes to the build.rs file. My current debug plan is to

This PR is the first part. Here is a sample output:

 ~/near/nearcore $ cargo clean && cargo build -p near-test-contracts --features test_features
 ~/near/nearcore $ cat target/debug/build/near-test-contracts-c89ce330453445c7/output
cargo:rerun-if-env-changed=CARGO_FEATURE_TEST_FEATURES
debug: test_features = Ok("1")
debug: running command: cd "./test-contract-rs" && env -u CARGO_BUILD_RUSTFLAGS -u CARGO_ENCODED_RUSTFLAGS -u RUSTC_WORKSPACE_WRAPPER CARGO_TARGET_DIR="/home/wacban-near/near/nearcore/target/debug/build/near-test-contracts-c89ce330453445c7/out" RUSTFLAGS="-Dwarnings" "cargo" "build" "--target=wasm32-unknown-unknown" "--release" "--features" "latest_protocol,test_features"
cargo:rerun-if-changed=././test-contract-rs/src/lib.rs
cargo:rerun-if-changed=././test-contract-rs/Cargo.toml
debug: from = "/home/wacban-near/near/nearcore/target/debug/build/near-test-contracts-c89ce330453445c7/out/wasm32-unknown-unknown/release/./test_contract_rs.wasm", to = "./res/test_contract_rs.wasm"
debug: running command: cd "./test-contract-rs" && env -u CARGO_BUILD_RUSTFLAGS -u CARGO_ENCODED_RUSTFLAGS -u RUSTC_WORKSPACE_WRAPPER CARGO_TARGET_DIR="/home/wacban-near/near/nearcore/target/debug/build/near-test-contracts-c89ce330453445c7/out" RUSTFLAGS="-Dwarnings" "cargo" "build" "--target=wasm32-unknown-unknown" "--release" "--features" "latest_protocol,test_features,nightly"
cargo:rerun-if-changed=././test-contract-rs/src/lib.rs
cargo:rerun-if-changed=././test-contract-rs/Cargo.toml
debug: from = "/home/wacban-near/near/nearcore/target/debug/build/near-test-contracts-c89ce330453445c7/out/wasm32-unknown-unknown/release/./test_contract_rs.wasm", to = "./res/nightly_test_contract_rs.wasm"
debug: running command: cd "./contract-for-fuzzing-rs" && env -u CARGO_BUILD_RUSTFLAGS -u CARGO_ENCODED_RUSTFLAGS -u RUSTC_WORKSPACE_WRAPPER CARGO_TARGET_DIR="/home/wacban-near/near/nearcore/target/debug/build/near-test-contracts-c89ce330453445c7/out" RUSTFLAGS="-Dwarnings" "cargo" "build" "--target=wasm32-unknown-unknown" "--release"
cargo:rerun-if-changed=././contract-for-fuzzing-rs/src/lib.rs
cargo:rerun-if-changed=././contract-for-fuzzing-rs/Cargo.toml
debug: from = "/home/wacban-near/near/nearcore/target/debug/build/near-test-contracts-c89ce330453445c7/out/wasm32-unknown-unknown/release/./contract_for_fuzzing_rs.wasm", to = "./res/contract_for_fuzzing_rs.wasm"
debug: running command: cd "./estimator-contract" && env -u CARGO_BUILD_RUSTFLAGS -u CARGO_ENCODED_RUSTFLAGS -u RUSTC_WORKSPACE_WRAPPER CARGO_TARGET_DIR="/home/wacban-near/near/nearcore/target/debug/build/near-test-contracts-c89ce330453445c7/out" RUSTFLAGS="-Dwarnings" "cargo" "build" "--target=wasm32-unknown-unknown" "--release"
cargo:rerun-if-changed=././estimator-contract/src/lib.rs
cargo:rerun-if-changed=././estimator-contract/Cargo.toml
debug: from = "/home/wacban-near/near/nearcore/target/debug/build/near-test-contracts-c89ce330453445c7/out/wasm32-unknown-unknown/release/./estimator_contract.wasm", to = "./res/stable_estimator_contract.wasm"
debug: running command: cd "./estimator-contract" && env -u CARGO_BUILD_RUSTFLAGS -u CARGO_ENCODED_RUSTFLAGS -u RUSTC_WORKSPACE_WRAPPER CARGO_TARGET_DIR="/home/wacban-near/near/nearcore/target/debug/build/near-test-contracts-c89ce330453445c7/out" RUSTFLAGS="-Dwarnings" "cargo" "build" "--target=wasm32-unknown-unknown" "--release" "--features" "nightly"
cargo:rerun-if-changed=././estimator-contract/src/lib.rs
cargo:rerun-if-changed=././estimator-contract/Cargo.toml
debug: from = "/home/wacban-near/near/nearcore/target/debug/build/near-test-contracts-c89ce330453445c7/out/wasm32-unknown-unknown/release/./estimator_contract.wasm", to = "./res/nightly_estimator_contract.wasm"
codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 71.77%. Comparing base (03a8b5d) to head (41f42f0).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #11738 +/- ## ========================================== - Coverage 71.78% 71.77% -0.01% ========================================== Files 792 792 Lines 162586 162586 Branches 162586 162586 ========================================== - Hits 116705 116703 -2 - Misses 40835 40836 +1 - Partials 5046 5047 +1 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | Coverage Δ | | |---|---|---| | [backward-compatibility](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.23% <ø> (ø)` | | | [db-migration](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.23% <ø> (ø)` | | | [genesis-check](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.35% <ø> (ø)` | | | [integration-tests](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `37.81% <ø> (-0.09%)` | :arrow_down: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.27% <ø> (+<0.01%)` | :arrow_up: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.37% <ø> (-0.01%)` | :arrow_down: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `54.64% <ø> (+1.33%)` | :arrow_up: | | [pytests](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.58% <ø> (ø)` | | | [sanity-checks](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.38% <ø> (ø)` | | | [unittests](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `66.20% <ø> (+<0.01%)` | :arrow_up: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/11738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.27% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

wacban commented 1 week ago

Is it possible that a parallel build of this crate might overwrite the correctly built contract here before python tests gets to snag the contract for its needs?

Hmm yeah that seems possible. I am not aware of any other builds happening on the nayduck builder but obviously I'm missing something somewhere so I'll keep a lookout for this.