Open malikwirin opened 2 months ago
Hello @malikwirin Thanks for reporting, I'm looking into this now.
Couple of things to consider:
cargo test -j 8 ...
, ideally, we would want to run cargo tst
which is an alias for cargo nextest
.But this is a side note, I don't think it would actually fix the issue.
Hi @hugocaillard Thanks for your response. I am very busy but still very determined to get it packaged for nix eventually. For the test comand:
So testing config should look something like that propably
rustPlatform.buildRustPackage {
/* ... */
useNextest = true;
checkFlags = [
"--workspace --locked --exclude clarinet-sdk-wasm --exclude clarity-jupyter-kernel"
];
}
Currently I am doing this for my setup but I could imagine upstreaming it when it follows best practices. I am currently not sure where. You could propably eventually write everything into a single flake.nix and have it in the root directory of clarinet like how its done in many projects. Maybe Nix-Bitcoin would accept it and eventually the regular nixpkgs.
Opening up such a Pull Request would enable more people to debug this. But I will give you info when rebuilding it with the new testing config.
This did not work actually it should have been
rust.Platform.buildRustPackage {
/* ... */
useNextest = true;
checkPhase = ''
cargo tst
'';
}
So we are making progress. This time I had 174 passing tests.
Running [ 00:00:02] [=> ] 142/460: 8 running, 142 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 143/460: 7 running, 143 passed, 0 skipped ^M PASS [ 0.056s] clarity-repl analysis::check_checker::tests::trusted_caller
Running [ 00:00:02] [=> ] 143/460: 8 running, 143 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 143/460: 8 running, 143 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 144/460: 7 running, 144 passed, 0 skipped ^M PASS [ 0.056s] clarity-repl analysis::check_checker::tests::trusted_caller_after
Running [ 00:00:02] [=> ] 144/460: 8 running, 144 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 145/460: 7 running, 145 passed, 0 skipped ^M PASS [ 0.056s] clarity-repl analysis::check_checker::tests::trusted_caller_disabled
Running [ 00:00:02] [=> ] 145/460: 8 running, 145 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 145/460: 8 running, 145 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 146/460: 7 running, 146 passed, 0 skipped ^M PASS [ 0.056s] clarity-repl analysis::check_checker::tests::trusted_sender
Running [ 00:00:02] [=> ] 146/460: 8 running, 146 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 147/460: 7 running, 147 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 147/460: 8 running, 147 passed, 0 skipped ^M PASS [ 0.056s] clarity-repl analysis::check_checker::tests::trusted_sender_after
Running [ 00:00:02] [=> ] 147/460: 8 running, 147 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 148/460: 7 running, 148 passed, 0 skipped ^M PASS [ 0.056s] clarity-repl analysis::check_checker::tests::trusted_sender_disabled
Running [ 00:00:02] [=> ] 148/460: 8 running, 148 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 149/460: 7 running, 149 passed, 0 skipped ^M PASS [ 0.057s] clarity-repl analysis::check_checker::tests::unchecked_params_safe
Running [ 00:00:02] [=> ] 149/460: 8 running, 149 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 149/460: 8 running, 149 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 150/460: 7 running, 150 passed, 0 skipped ^M PASS [ 0.057s] clarity-repl analysis::check_checker::tests::unchecked_params_safe_after
Running [ 00:00:02] [=> ] 150/460: 8 running, 150 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 151/460: 7 running, 151 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 151/460: 8 running, 151 passed, 0 skipped ^M PASS [ 0.059s] clarity-repl analysis::coverage_tests::branch_if_plus_and
Running [ 00:00:02] [=> ] 151/460: 8 running, 151 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 152/460: 7 running, 152 passed, 0 skipped ^M PASS [ 0.060s] clarity-repl analysis::coverage_tests::branch_if_plus_or
Running [ 00:00:02] [=> ] 152/460: 8 running, 152 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 152/460: 8 running, 152 passed, 0 skipped ^M Running [ 00:00:02] [=> ] 153/460: 7 running, 153 passed, 0 skipped ^M PASS [ 0.061s] clarity-repl analysis::coverage_tests::filter_iterator
Running [ 00:00:02] [=> ] 153/460: 8 running, 153 passed, 0 skipped ^M Running [ 00:00:02] [==> ] 154/460: 7 running, 154 passed, 0 skipped ^M PASS [ 0.060s] clarity-repl analysis::coverage_tests::fold_iterator
Running [ 00:00:03] [==> ] 154/460: 8 running, 154 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 154/460: 8 running, 154 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 155/460: 7 running, 155 passed, 0 skipped ^M PASS [ 0.094s] clarity-repl analysis::coverage_tests::function_hit_should_have_line_hit
Running [ 00:00:03] [==> ] 155/460: 8 running, 155 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 155/460: 8 running, 155 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 155/460: 7 running, 156 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 156/460: 7 running, 156 passed, 0 skipped ^M PASS [ 0.124s] clarity-repl analysis::coverage_tests::hit_all_if_branches
Running [ 00:00:03] [==> ] 156/460: 8 running, 156 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 157/460: 7 running, 157 passed, 0 skipped ^M PASS [ 0.060s] clarity-repl analysis::coverage_tests::line_count_in_iterator
Running [ 00:00:03] [==> ] 157/460: 8 running, 157 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 157/460: 8 running, 157 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 158/460: 7 running, 158 passed, 0 skipped ^M PASS [ 0.128s] clarity-repl analysis::coverage_tests::let_binding
Running [ 00:00:03] [==> ] 158/460: 8 running, 158 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 158/460: 8 running, 158 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 159/460: 7 running, 159 passed, 0 skipped ^M PASS [ 0.061s] clarity-repl analysis::coverage_tests::line_is_executed
Running [ 00:00:03] [==> ] 159/460: 8 running, 159 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 159/460: 8 running, 159 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 160/460: 7 running, 160 passed, 0 skipped ^M PASS [ 0.063s] clarity-repl analysis::coverage_tests::map_iterator
Running [ 00:00:03] [==> ] 160/460: 8 running, 160 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 160/460: 8 running, 160 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 161/460: 7 running, 161 passed, 0 skipped ^M PASS [ 0.125s] clarity-repl analysis::coverage_tests::line_is_executed_twice
Running [ 00:00:03] [==> ] 161/460: 8 running, 161 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 162/460: 7 running, 162 passed, 0 skipped ^M PASS [ 0.073s] clarity-repl analysis::coverage_tests::match_opt_multiline
Running [ 00:00:03] [==> ] 162/460: 8 running, 162 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 162/460: 8 running, 162 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 163/460: 7 running, 163 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 163/460: 8 running, 163 passed, 0 skipped ^M PASS [ 0.068s] clarity-repl analysis::coverage_tests::match_res_oneline
Running [ 00:00:03] [==> ] 163/460: 8 running, 163 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 163/460: 8 running, 163 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 164/460: 7 running, 164 passed, 0 skipped ^M PASS [ 0.119s] clarity-repl analysis::coverage_tests::match_opt_oneline
Running [ 00:00:03] [==> ] 164/460: 8 running, 164 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 165/460: 7 running, 165 passed, 0 skipped ^M PASS [ 0.061s] clarity-repl analysis::coverage_tests::multiple_line_execution
Running [ 00:00:03] [==> ] 165/460: 8 running, 165 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 165/460: 8 running, 165 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 166/460: 7 running, 166 passed, 0 skipped ^M PASS [ 0.070s] clarity-repl analysis::coverage_tests::simple_asserts_branching
Running [ 00:00:03] [==> ] 166/460: 8 running, 166 passed, 0 skipped ^M Running [ 00:00:03] [==> ] 167/460: 7 running, 167 passed, 0 skipped ^M FAIL [ 3.531s] clarinet-cli::bin/clarinet lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis
--- STDOUT: clarinet-cli::bin/clarinet lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis ---
running 1 test
test lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis ... FAILED
failures:
failures:
lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 4 filtered out; finished in 3.51s
--- STDERR: clarinet-cli::bin/clarinet lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis ---
thread 'lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis' panicked at components/clarinet-cli/src/lsp/mod.rs:231:5:
assertion `left == right` failed
left: 0
right: 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Running [ 00:00:03] [==> ] 167/460: 8 running, 167 passed, 0 skipped ^M Canceling due to test failure: 7 tests still running
Running [ 00:00:03] [] 168/460: 7 running, 167 passed, 1 failed, 0 skipped ^M^M Canceling [ 00:00:03] [] 168/460: 7 running, 167 passed, 1 failed, 0 skipped ^M^M PASS [ 0.009s] clarity-repl frontend::terminal::tests::test_complete_input::complete_input_with_curly_braces
Canceling [ 00:00:03] [] 168/460: 8 running, 167 passed, 1 failed, 0 skipped ^M^M Canceling [ 00:00:03] [] 168/460: 8 running, 167 passed, 1 failed, 0 skipped ^M^M PASS [ 0.064s] clarity-repl analysis::coverage_tests::simple_if_branches_with_exprs
Canceling [ 00:00:03] [] 169/460: 7 running, 168 passed, 1 failed, 0 skipped ^M^M PASS [ 0.079s] clarity-repl analysis::coverage_tests::simple_if_branching
Canceling [ 00:00:03] [] 170/460: 6 running, 169 passed, 1 failed, 0 skipped ^M^M Canceling [ 00:00:03] [] 170/460: 6 running, 169 passed, 1 failed, 0 skipped ^M^M FAIL [ 3.633s] clarinet-cli lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis
--- STDOUT: clarinet-cli lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis ---
running 1 test
test lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis ... FAILED
failures:
failures:
lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 4 filtered out; finished in 3.62s
--- STDERR: clarinet-cli lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis ---
thread 'lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis' panicked at components/clarinet-cli/src/lsp/mod.rs:231:5:
assertion `left == right` failed
left: 0
right: 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Canceling [ 00:00:03] [] 171/460: 5 running, 170 passed, 1 failed, 0 skipped ^M^M Canceling [ 00:00:03] [] 172/460: 4 running, 170 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:03] [] 172/460: 4 running, 170 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:03] [] 172/460: 4 running, 170 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 172/460: 4 running, 170 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 172/460: 4 >
Canceling [ 00:00:04] [] 172/460: 4 running, 170 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 172/460: 4 running, 170 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 172/460: 3 running, 171 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 172/460: 3 running, 171 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 173/460: 3 running, 171 passed, 2 failed, 0 skipped ^M^M PASS [ 4.538s] clarinet-cli l>
Canceling [ 00:00:04] [] 173/460: 3 running, 171 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 173/460: 3 running, 171 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 173/460: 2 running, 172 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 173/460: 2 running, 172 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 174/460: 2 running, 172 passed, 2 failed, 0 skipped ^M^M PASS [ 4.626s] clarinet-cli l>
Canceling [ 00:00:04] [] 174/460: 2 running, 172 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 174/460: 2 running, 172 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 174/460: 1 running, 173 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 174/460: 1 running, 173 passed, 2 failed, 0 skipped ^M^M PASS [ 4.722s] clarinet-cli::bin/clarinet lsp::test_opening_counter_contract_should_return_fresh_analysis
Canceling [ 00:00:04] [] 175/460: 1 running, 173 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 175/460: 1 running, 173 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 175/460: 0 running, 174 passed, 2 failed, 0 skipped ^M^M Canceling [ 00:00:04] [] 175/460: 0 running, 174 passed, 2 failed, 0 skipped ^M^M------------
Summary [ 4.725s] 176/460 tests run: 174 passed, 2 failed, 0 skipped
FAIL [ 3.633s] clarinet-cli lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis
FAIL [ 3.531s] clarinet-cli::bin/clarinet lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis
Canceling [ 00:00:04] [] 176/460: 0 running, 174 passed, 2 failed, 0 skipped ^M^Merror: test run failed
It's still clarinet-cli::bin/clarinet lsp::test_opening_simple_nft_manifest_should_return_fresh_analysis which fails. What may have caused this?
What mode is the rust package build for testing normally? In my nix setup it uses release mode by default, but should I maybe use debug mode?
What may have caused this?
I don't know. As suggested in my previous comment, is it possible for you to add a log?
What mode is the rust package build for testing normally? In my nix setup it uses release mode by default, but should I maybe use debug mode?
Both seem to work on my end
So I included a patch to get the value of manifest_location:
println!("Manifest location: {:?}", manifest_location);
The value is "/build/source/components/clarinet-cli/examples/simple-nft/Clarinet.toml"
I am currently trying to package clarinet for NixOS like I talked about in #1515 . I have the following package definition:
There is also a Cargo.lock file in the directory of the nix file. I can post its content if necessary. The build phase runs successful, but the checkPhase doesn't. With the following log:
Inside the failing test
response.aggregated_diagnostics.len()
returns 0 even though it should return 1. What may cause this?