projectfluent / fluent-rs

Rust implementation of Project Fluent
https://projectfluent.org
Apache License 2.0
1.05k stars 95 forks source link

Move tests to GitHub Actions #212

Closed flodolo closed 3 years ago

flodolo commented 3 years ago

Currently cargo-tarpaulin and codecov are disabled.

cargo-tarpaulin

I tried installing via both the action and by running the command used in Travis, both fail on intl_pluralrules. Note that Travis is failing in the same way, but the error is not reported 🤷🏻‍♂️

Compiling intl_pluralrules v7.0.0
error: Broken pipe (os error 32)
Error: warning: build failed, waiting for other jobs to finish...
thread 'main' panicked at 'already borrowed: BorrowMutError', src/tools/cargo/src/cargo/util/config/mod.rs:307:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Jan 04 19:00:44.295 ERROR cargo_tarpaulin: Failed to compile tests! Error: cannot find attribute `skip` in this scope
Error: "Failed to compile tests! Error: cannot find attribute `skip` in this scope"
Error: The process '/usr/share/rust/.cargo/bin/cargo' failed with exit code 1

codecov

It requires to set up a secret in the repository, so it might be done as a follow-up.

This is a clean run on my fork. Based on the experience with Pontoon, actions won't run automatically on this pull request because it comes from a fork, it will run only if the PR is made from a branch in the repository itself. In case, feel free to use this as a starting point.

flodolo commented 3 years ago

Output with RUST_BACKTRACE: 1

   Compiling intl_pluralrules v7.0.0
error: Broken pipe (os error 32)
Error: warning: build failed, waiting for other jobs to finish...
thread 'main' panicked at 'already borrowed: BorrowMutError', src/tools/cargo/src/cargo/util/config/mod.rs:307:20
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:495:5
   1: core::panicking::panic_fmt
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/panicking.rs:92:14
   2: core::option::expect_none_failed
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/option.rs:1268:5
   3: cargo::core::compiler::job_queue::DrainState::drain_the_queue
   4: std::panic::catch_unwind
   5: crossbeam_utils::thread::scope
   6: cargo::core::compiler::job_queue::JobQueue::execute
   7: cargo::core::compiler::context::Context::compile
   8: cargo::ops::cargo_compile::compile_ws
   9: cargo::ops::cargo_compile::compile
  10: cargo::ops::cargo_test::compile_tests
  11: cargo::ops::cargo_test::run_tests
  12: cargo::commands::test::exec
  13: cargo::cli::main
  14: cargo::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Jan 05 05:53:11.083 ERROR cargo_tarpaulin: Failed to compile tests! Error: cannot find attribute `skip` in this scope
Error: "Failed to compile tests! Error: cannot find attribute `skip` in this scope"

Output with RUST_BACKTRACE: full

   Compiling intl_pluralrules v7.0.0
error: Broken pipe (os error 32)
Error: warning: build failed, waiting for other jobs to finish...
thread 'main' panicked at 'already borrowed: BorrowMutError', src/tools/cargo/src/cargo/util/config/mod.rs:307:20
stack backtrace:
   0:     0x55831b256360 - std::backtrace_rs::backtrace::libunwind::trace::h04d12fdcddff82aa
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/../../backtrace/src/backtrace/libunwind.rs:100:5
   1:     0x55831b256360 - std::backtrace_rs::backtrace::trace_unsynchronized::h1459b974b6fbe5e1
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55831b256360 - std::sys_common::backtrace::_print_fmt::h9b8396a669123d95
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x55831b256360 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he009dcaaa75eed60
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x55831b2811bc - core::fmt::write::h77b4746b0dea1dd3
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/fmt/mod.rs:1078:17
   5:     0x55831b24d5e2 - std::io::Write::write_fmt::heb7e50902e98831c
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/io/mod.rs:1518:15
   6:     0x55831b25a615 - std::sys_common::backtrace::_print::h2d880c9e69a21be9
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x55831b25a615 - std::sys_common::backtrace::print::h5f02b1bb49f36879
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x55831b25a615 - std::panicking::default_hook::{{closure}}::h658e288a7a809b29
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:208:50
   9:     0x55831b25a2b8 - std::panicking::default_hook::hb52d73f0da9a4bb8
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:227:9
  10:     0x55831b25adb1 - std::panicking::rust_panic_with_hook::hfe7e1c684e3e6462
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:593:17
  11:     0x55831b25a8f7 - std::panicking::begin_panic_handler::{{closure}}::h42939e004b32765c
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:499:13
  12:     0x55831b25681c - std::sys_common::backtrace::__rust_end_short_backtrace::h9d2070f7bf9fd56c
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/sys_common/backtrace.rs:141:18
  13:     0x55831b25a859 - rust_begin_unwind
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:495:5
  14:     0x55831b27f841 - core::panicking::panic_fmt::ha0bb065d9a260792
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/panicking.rs:92:14
  15:     0x55831b27f663 - core::option::expect_none_failed::h7e1dd0a94971eb61
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/option.rs:1268:5
  16:     0x55831ab04ecd - cargo::core::compiler::job_queue::DrainState::drain_the_queue::h57fa2b25afbf7869
  17:     0x55831ab47fa3 - std::panic::catch_unwind::hde7ba071508b1cfe
  18:     0x55831aa6a00e - crossbeam_utils::thread::scope::hce0c28857279ee8d
  19:     0x55831aaff755 - cargo::core::compiler::job_queue::JobQueue::execute::hbc59c947c0d197fa
  20:     0x55831aa2ae6d - cargo::core::compiler::context::Context::compile::hbffb7abc53d2829a
  21:     0x55831acd7721 - cargo::ops::cargo_compile::compile_ws::h2caa47c62d1a504f
  22:     0x55831acd747e - cargo::ops::cargo_compile::compile::h26d4da5d84812612
  23:     0x55831ad49672 - cargo::ops::cargo_test::compile_tests::h5b80b2cdc44b4899
  24:     0x55831ad463d2 - cargo::ops::cargo_test::run_tests::h7c23a0717d185069
  25:     0x55831a945cc3 - cargo::commands::test::exec::heafcdc9f22471d13
  26:     0x55831a8e0ad9 - cargo::cli::main::h03312c990235a031
  27:     0x55831a946ac8 - cargo::main::hec07e54231ca0014
  28:     0x55831a93d433 - std::sys_common::backtrace::__rust_begin_short_backtrace::h953ffbfbedbe3f45
  29:     0x55831a93d6a9 - std::rt::lang_start::{{closure}}::h21a7e453cd087627
  30:     0x55831b25b2c7 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h57e2a071d427b24c
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/ops/function.rs:259:13
  31:     0x55831b25b2c7 - std::panicking::try::do_call::h81cbbe0c3b30a28e
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:381:40
  32:     0x55831b25b2c7 - std::panicking::try::hbeeb95b4e1f0a876
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:345:19
  33:     0x55831b25b2c7 - std::panic::catch_unwind::h59c48ccb40a0bf20
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panic.rs:396:14
  34:     0x55831b25b2c7 - std::rt::lang_start_internal::ha53ab63f88fee728
                               at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/rt.rs:51:25
  35:     0x55831a949282 - main
  36:     0x7fee99bd9bf7 - __libc_start_main
  37:     0x55831a8d5071 - <unknown>
Jan 05 06:03:20.397 ERROR cargo_tarpaulin: Failed to compile tests! Error: cannot find attribute `skip` in this scope
flodolo commented 3 years ago

Additional notes: versions seem correct (Rust 1.49.0, Tarpaulin 0.16.0). I tried running it on Nightly (1.51), but got the same error. Now I'm trying to run it without the "profile: minimal" to see if it makes any difference.

UPDATE: no difference with the default profile.

flodolo commented 3 years ago

This is the log for the current version of the code. At this point, this is stuck until someone figures out the rust error https://github.com/flodolo/fluent-rs/runs/1648278329?check_suite_focus=true

UPDATE: since the last Travis run for intl_pluralrules worked, I tried using 0.15.0 for Tarpaulin instead of latest, but got the same error.

flodolo commented 3 years ago

OK, with the new version I have a green run 🍾 https://github.com/flodolo/fluent-rs/actions/runs/463667557

As explained above, codecov and tarpaulin are currently running only with stable+all-features, in case it's easy to change the logic and run it for both variants of stable.

The codecov part is still commented out and untested. One possible way forward is to:

  1. Merge this PR
  2. Create a new PR, add the secret to the repo and uncomment the code
  3. Check if it works

Any new PR will run actions automatically, even if coming from a fork.

I'm not familiar with codecov at all, so not sure I can help there.