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

ci: compile test_examples{,_small}.yml with near_workspaces::compile_project #1253

Merged
merged 21 commits into from
Nov 18, 2024

Conversation

dj8yfo
Copy link
Collaborator

@dj8yfo dj8yfo commented Nov 5, 2024

No description provided.

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.30%. Comparing base (7a8dd79) to head (c6c9512).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1253      +/-   ##
==========================================
+ Coverage   80.14%   80.30%   +0.16%     
==========================================
  Files         102      102              
  Lines       14598    14598              
==========================================
+ Hits        11699    11723      +24     
+ Misses       2899     2875      -24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Nov 6, 2024

fail-fast was disabled for matrices to see full information of what's failing in ci to avoid having to do more sequential run-ci/change-code cycles

@dj8yfo dj8yfo marked this pull request as ready for review November 6, 2024 12:16
@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Nov 6, 2024

@race-of-sloths include

@race-of-sloths
Copy link

race-of-sloths commented Nov 6, 2024

@dj8yfo Thank you for your contribution! Your pull request is now a part of the Race of Sloths!

Shows inviting banner with latest news.

Shows profile picture for the author of the PR

Current status: waiting for finalization

The pull request is merged, you have 24 hours to finalize your scoring. The scoring ends Tue Nov 19 14:44:37 2024

Reviewer Score
@frol 8

Your contribution is much appreciated with a final score of 8!
You have received 80 Sloth points for this contribution

@frol received 25 Sloth Points for reviewing and scoring this pull request.

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths and receive a reward
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

@dj8yfo dj8yfo force-pushed the near_workspaces_compile_project branch from f806125 to 7be211e Compare November 7, 2024 18:06
@dj8yfo dj8yfo changed the title ci: compile test-examples.yml with near_workspaces::compile_project ci: compile test_examples{,_small}.yml with near_workspaces::compile_project Nov 7, 2024
Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

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

@dj8yfo Overall, it looks great, but how much did it affect CI times?

examples/adder/src/lib.rs Show resolved Hide resolved
Comment on lines +16 to +21
#[rstest]
#[tokio::test]
async fn simulate_simple_approve() -> anyhow::Result<()> {
let worker = near_workspaces::sandbox().await?;
let (nft_contract, alice, token_receiver_contract, _) = init(&worker).await?;
async fn simulate_simple_approve(
#[future] initialized_contracts: anyhow::Result<(Contract, Account, Contract, Contract)>,
) -> anyhow::Result<()> {
let (nft_contract, alice, token_receiver_contract, _) = initialized_contracts.await?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we win much from using fixtures here? It took me several minutes to figure out and I think it is unnecessary magical, and makes the code less readable. Also, rstest dependency might add extra compilation time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

such a minimal manifest with rstest with a corresponding test

[package]
name = "rstest_play"
version = "0.1.0"
edition = "2021"

[dependencies]

[dev-dependencies]
rstest = "0.23.0"

compiles for

   Compiling rstest v0.23.0
    Finished `test` profile [unoptimized + debuginfo] target(s) in 4.86s

on my machine, which would probably mean 10-15 secs on gh executor

examples/fungible-token/tests/workspaces.rs Outdated Show resolved Hide resolved
@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Nov 11, 2024

referencing nearuaguild/abstract-dao#9 , as full picture will be important anyway.

Likely the contract therein has been fixed by changes introduces, because the state of the base branch of pr
reacted with status: Failure(ActionError(ActionError { index: Some(0), kind: FunctionCallError(CompilationError(PrepareError(Deserialization))) })) in its only test test_sign_eip1559_payload_on_many_chains , that uses near_workspaces::sandbox, if run on 1.82.

Whereas the test passes in the compare branch of pr on 1.82

akorchyn pushed a commit to near/near-workspaces-rs that referenced this pull request Nov 15, 2024
…386)

PR addresses this TODO
near/near-sdk-rs#1253 (comment) ,
which later ~will be~ has been removed from `near-sdk` code, for cases:
1. when non-async function is required in `static
std::sync::OnceLock<T>/LazyLock<T, F>` creation like here
https://github.com/dj8yfo/near-sdk-rs/blob/7be211e1b2991f6c5b4db78972784dac2f066e32/examples/fungible-token/tests/workspaces.rs#L47
2. when non-default build is required like with `no-abi` here
https://github.com/dj8yfo/abstract-dao/blob/fe9d16797bf582f0ea24380c1e4ad6bdb8c97283/tests/common.rs#L33

PR avoids necessity to import `cargo-near-build` separately as a
dependency

PR should best be published with a major release, to avoid weird
breakage `0.14.1 -> 0.14.x`

Co-authored-by: dj8yf0μl <[email protected]>
Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

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

@race-of-sloths score 8

@frol frol merged commit 80723b9 into near:master Nov 18, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants