Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e496b3f
fix(ci): try codecov on hosted runner
hanabi1224 Dec 18, 2025
5a8675d
Merge branch 'main' into hm/try-codecov-on-hosted-runner
hanabi1224 Dec 19, 2025
afa58f3
fix tests
hanabi1224 Dec 19, 2025
45f74a8
sccache for test-release
hanabi1224 Dec 19, 2025
80b2f2e
fix AI comment
hanabi1224 Dec 19, 2025
6ad6456
fetch proof params with docker
hanabi1224 Dec 19, 2025
9425181
Merge remote-tracking branch 'origin/main' into hm/speed-up-tests
hanabi1224 Dec 19, 2025
4edf480
prove the fetch
hanabi1224 Dec 19, 2025
73b3d8f
Merge branch 'main' into hm/speed-up-tests
hanabi1224 Dec 19, 2025
0eb2812
set permission
hanabi1224 Dec 19, 2025
00f0d72
fetch proof params for test-release as well
hanabi1224 Dec 19, 2025
a74c99c
less log
hanabi1224 Dec 19, 2025
284ec79
nextest
hanabi1224 Dec 19, 2025
836b7a2
no nextest
hanabi1224 Dec 19, 2025
89ba6d9
fetch proof params only once
hanabi1224 Dec 19, 2025
f63bdc1
more retry in downloading rpc snapshots
hanabi1224 Dec 19, 2025
b5de8d1
FOREST_TEST_SKIP_PROOF_PARAM_CHECK
hanabi1224 Dec 19, 2025
7ea16b7
pre-fetch rpc test snapshots
hanabi1224 Dec 19, 2025
f136bdd
speedup nextest build
hanabi1224 Dec 19, 2025
f3dae30
fix
hanabi1224 Dec 19, 2025
d056b6a
Merge remote-tracking branch 'origin/main' into hm/speed-up-tests
hanabi1224 Jan 6, 2026
c0d2813
run codecov on hosted runner
hanabi1224 Jan 6, 2026
400b88e
Merge remote-tracking branch 'origin/main' into hm/speed-up-tests
hanabi1224 Jan 6, 2026
fb1eb32
Merge branch 'main' into hm/speed-up-tests
hanabi1224 Jan 7, 2026
a208961
restore Makefile
hanabi1224 Jan 7, 2026
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
14 changes: 14 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ env:
CI: 1
CARGO_INCREMENTAL: 0
CACHE_TIMEOUT_MINUTES: 5
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
RUSTC_WRAPPER: sccache
CC: sccache clang
CXX: sccache clang++
# To minimize compile times: https://nnethercote.github.io/perf-book/build-configuration.html#minimizing-compile-times
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT: 1
FIL_PROOFS_PARAMETER_CACHE: /var/tmp/filecoin-proof-parameters

jobs:
codecov:
Expand All @@ -41,6 +45,14 @@ jobs:
runs-on: buildjet-4vcpu-ubuntu-2204
timeout-minutes: 45
steps:
- name: Configure SCCache variables
run: |
# External PRs do not have access to 'vars' or 'secrets'.
if [[ "${{secrets.AWS_ACCESS_KEY_ID}}" != "" ]]; then
echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV
echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV
echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV
fi
- uses: actions/checkout@v6
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
Expand All @@ -51,6 +63,8 @@ jobs:
go-version-file: "go.work"
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest
- name: Fetch proof params
run: cargo run --bin forest-tool --no-default-features -- fetch-params --keys

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it be faster to fetch them via docker? I don't think there's a need to compile it unless we're reusing the same compilation units in the codecov stage compilation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

True, I can switch to docker

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@hanabi1224 hanabi1224 Jan 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It turns out that fetching only parameter files is insufficient, we need to pre-fetch RPC test snapshots as well to save time and reduce flakyness. Switched to forest-dev solution.

- name: Generate code coverage
run: make codecov
# Save lcov.info as an artifact for debugging purposes
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ env:
CI: 1
CARGO_INCREMENTAL: 0
CACHE_TIMEOUT_MINUTES: 5
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
RUSTC_WRAPPER: "sccache"
CC: "sccache clang"
CXX: "sccache clang++"
FIL_PROOFS_PARAMETER_CACHE: /var/tmp/filecoin-proof-parameters

jobs:
tests-release:
Expand All @@ -39,6 +42,14 @@ jobs:
# This is done to limit the runner cost.
if: github.event.pull_request.draft == false
steps:
- name: Configure SCCache variables
run: |
# External PRs do not have access to 'vars' or 'secrets'.
if [[ "${{secrets.AWS_ACCESS_KEY_ID}}" != "" ]]; then
echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV
echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV
echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV
fi
# find the nearest S3 space for storing cache files
- name: Show IP
run: curl ifconfig.me
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ test-release-docs:
cargo test --profile quick --doc --features doctest-private

codecov:
cargo llvm-cov --workspace --codecov --output-path lcov.info
cargo llvm-cov -p forest-filecoin --no-default-features --codecov --output-path lcov.info
Comment thread
LesnyRumcajs marked this conversation as resolved.
Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

--no-default-features saves ~3min

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't we run tests with same features (and thus code paths) that the actual binary runs with?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@LesnyRumcajs Restored Makefile. It's jemalloc being slow to build


# Checks if all headers are present and adds if not
license:
Expand Down
11 changes: 9 additions & 2 deletions src/utils/proofs_api/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,15 @@ pub(super) async fn check_parameter_file(path: &Path, info: &ParameterData) -> a
// environment variable is set.
pub(super) fn param_dir(data_dir: &Path) -> PathBuf {
std::env::var(PathBuf::from(PROOFS_PARAMETER_CACHE_ENV))
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
.map(PathBuf::from)
.unwrap_or_else(|_| data_dir.join(PARAM_DIR))
.ok()
.and_then(|v| {
if v.is_empty() {
None
} else {
Some(PathBuf::from(v))
}
})
.unwrap_or_else(|| data_dir.join(PARAM_DIR))
}

/// Forest uses a set of external crates for verifying the proofs generated by
Expand Down
5 changes: 4 additions & 1 deletion tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ impl CommonEnv for Command {
// Always downloads proofs to same location to lower the overall test time
// (by reducing multiple "fetching param file" steps).
fn common_env(&mut self) -> &mut Self {
self.env("FIL_PROOFS_PARAMETER_CACHE", "/tmp/forest-test-fil-proofs")
match std::env::var("FIL_PROOFS_PARAMETER_CACHE").ok() {
Some(v) if !v.is_empty() => self,
_ => self.env("FIL_PROOFS_PARAMETER_CACHE", "/tmp/forest-test-fil-proofs"),
}
}
}

Expand Down
1 change: 1 addition & 0 deletions tests/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ fn test_download_location_of_proof_parameter_files_default() {

tool()
.env("FOREST_CONFIG_PATH", config_file.path())
.env("FIL_PROOFS_PARAMETER_CACHE", "")
.arg("fetch-params")
.arg("--keys")
.arg("--dry-run")
Expand Down
Loading