Giter VIP home page Giter VIP logo

Comments (4)

Geigerkind avatar Geigerkind commented on May 30, 2024 1

I have tried using this flag together with the panic=abort flag. But it did not work with it.
I did not debug this any further.

The coverage report looks fine though. I did not notice any significant difference.

from testcontainers-rs.

thomaseizinger avatar thomaseizinger commented on May 30, 2024

Interesting, I have not encountered that so far.

We are running tests based on testcontainers in GitHub actions CI just fine: https://github.com/comit-network/comit-rs/runs/777309093?check_suite_focus=true#step:9:216

I traced the error you are getting to this line inside the Rust source code:

https://github.com/rust-lang/rust/blob/e8ff4bcbd02475cf487cd101bf32954dc63366d4/src/libtest/lib.rs#L496

Looking where RunStrategy gets set, we arrive here:

https://github.com/rust-lang/rust/blob/e8ff4bcbd02475cf487cd101bf32954dc63366d4/src/libtest/lib.rs#L252-L256

You are setting panic_abort in your CI here:

https://github.com/Geigerkind/LegacyPlayersV3/blob/c334cefee289754c0e6a836a1c01e05270fdf054/.github/workflows/CI.yml#L31

Seems like you need to also set force_run_in_process to make sure the correct RunStrategy gets chosen :)

Hopefully that helps!

from testcontainers-rs.

Geigerkind avatar Geigerkind commented on May 30, 2024

Hey thomaseizinger,
thanks for the fast answer :)

I tried it here: https://github.com/Geigerkind/LegacyPlayersV3/runs/779513961?check_suite_focus=true#step:4:693
At least the failure message is different.

I also tried looking into how the comit-rs project is firing up the container in the test,
but I cant seem to make out where the container startup was defined.
(And I learned about actions/cache and how to mock in Rust :O, Nice)
https://github.com/comit-network/comit-rs/blob/dev/comit/tests/ethereum_go_back_into_the_past.rs

I also noticed that this is an tokio::test. As I have never worked with tokio, I dont know if this works differently.

Edit: But I can reproduce it locally now, will report back.

Edit2: -Cpanic=abort in my RUSTFLAGS was the problem. Now it works.
@thomaseizinger thanks a bunch for your help and thanks to you answer I even learned something new about rust by looking at your project!

from testcontainers-rs.

thomaseizinger avatar thomaseizinger commented on May 30, 2024

Hehe, glad you got it sorted and could learn something in the process :)

You might need panic=abort for the code coverage you are trying to do in your CI. Not quite sure but I've seen those flags be used in the past together with CI.

The code snippet from libtest I linked above hints that there is another flag you can pass, called something like "force-in-process" that should allow libtest to select the InProcess strategy despite you setting panic=abort.

So in case you need to to set panic=abort to get the code coverage working, I would look into setting that flag :)

from testcontainers-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.