Giter Site home page Giter Site logo

Integration Tests incorrect about bevy_ggrs HOT 2 CLOSED

gschup avatar gschup commented on July 18, 2024
Integration Tests incorrect

from bevy_ggrs.

Comments (2)

donedgardo avatar donedgardo commented on July 18, 2024

I'd love to contribute for this.
In general can we get a conversation going on what should be tested instead?

As a person integrating this library into their bevy game I'd like to see that:

  • Systems in the Rollback stage should run.
  • Rollback Components get synced between two applications with active session between each other.
  • Test simple integration (great for documentation) between bevy and the plugin.
  • Enough test that make us feel confident on improving the code and internal systems.

The test in the link provided would be a good start, I would remove line

assert_eq!(frame_count1.frame, frame_count2.frame);

It is not expected that the two systems are completely in sync only that both system are being scheduled and executed.

Additionally the second test would be a good candidate for the integration test and rollback behavior's:

fn it_syncs_rollback_components() -> Result<(), Box<dyn std::error::Error>> {

Now with thanks to this helper function or something very similar, we can now also test frame by frame scenarios/edge cases:

https://github.com/johanhelsing/bevy_xpbd_jondolf/blob/0d2582fc9fb6a5324d50f922d933612a76461d30/src/tests.rs#L33

fn tick_60_fps(app: &mut App) {
    let mut update_strategy = app.world.resource_mut::<TimeUpdateStrategy>();
    let TimeUpdateStrategy::ManualInstant(prev_time) = *update_strategy else { unimplemented!() };
    *update_strategy =
        TimeUpdateStrategy::ManualInstant(prev_time + Duration::from_secs_f64(1. / 60.));
    app.update();
}

from bevy_ggrs.

gschup avatar gschup commented on July 18, 2024

solved in #69 . we now have a nice basis to extend integration tests from if we wish to do so!

from bevy_ggrs.

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.