Skip to content

Conversation

piobab
Copy link
Collaborator

@piobab piobab commented Aug 18, 2023

no space left for test coverage in red-bank repo.

Problem:
Tests are structured:

tests
    test_deposit.rs
    test_borrow.rs
    test_withdraw.rs
    ...

Every test_ file gets treated as a separate crate.
Generating coverage requires to enable -Cinstrument-coverage flag which is used for report generation. It generates instrumented binary files for each test module (crate). These files can be quite large. It consumes almost 2x more space than normal cargo make test.

Solutions:

  1. Increase github worker disk space
  2. Run test cases one by one for every contract and cleanup used space after each run. Increase coverage job time (it is already quite long).
  3. Merge few seperate test_ files (crates) to one.
    before my PR target/coverage ~ 6,5 GB:
outposts on  fix/MP-3258-coverage [$] via 𝗥 v1.69.0
➜ du -sh target/*                       
4,0K    target/CACHEDIR.TAG
6,5G    target/coverage
122M    target/release
590M    target/wasm32-unknown-unknown

after my PR target/coverage ~ 4,3 GB (2,2 GB reduction):

outposts on  fix/MP-3258-coverage [$] via 𝗥 v1.69.0
➜ du -sh target/*
4,0K    target/CACHEDIR.TAG
4,3G    target/coverage
122M    target/release
  0B    target/tmp
591M    target/wasm32-unknown-unknown

We chose solution nr 3. End goal is to simplify these tests and move some of them (unit tests) close to original function (src) and in tests keeps only integration tests (multitest).

@brimigs brimigs self-requested a review August 22, 2023 15:11
@piobab piobab force-pushed the fix/MP-3258-coverage branch from 86d55b6 to 0f79e39 Compare August 23, 2023 08:06
@piobab
Copy link
Collaborator Author

piobab commented Aug 23, 2023

Resolved conflicts and removed unused comments.

@piobab piobab merged commit 04b40a9 into develop Aug 23, 2023
@piobab piobab deleted the fix/MP-3258-coverage branch September 14, 2023 08:09
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.

2 participants