Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #206

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Fix tests #206

wants to merge 3 commits into from

Conversation

jirutka
Copy link

@jirutka jirutka commented Nov 19, 2022

Now the tests finally pass.

However, it still doesn’t run on CI out-of-box because some of the tests are not unit tests but integration tests utilizing Gtk that require a display. I successfully run it via xvfb-run, but this provides a virtual X server, not a Wayland server. I haven’t found a similar tool for Wayland yet.

Fixes #197.

@jirutka jirutka force-pushed the fix-tests branch 2 times, most recently from 44e8649 to 82ad67d Compare November 19, 2022 19:38
@@ -64,10 +64,12 @@ test(
'--target-dir=@0@'.format(cargo_target_dir),
'--',
'--nocapture',
'--test-threads=1',
Copy link
Owner

Choose a reason for hiding this comment

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

Is this still required, even though gtk tests already run single threaded?

Copy link
Author

Choose a reason for hiding this comment

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

I wouldn't add it if it wasn't needed.

Copy link
Owner

Choose a reason for hiding this comment

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

I'm still not sure why this is still needed

@jirutka
Copy link
Author

jirutka commented Nov 15, 2023

Why is this still not merged? And yes, it’s still relevant.

https://github.com/gtk-rs/gtk-test#general-setup:
> When running test, you need to specify that you only want ONE thread.
> Otherwise, GTK contexts might conflict into each others.
There are multiple tests that require schema to be compiled and
GSETTINGS_SCHEMA_DIR set, not just the one in settings.rs. The other
tests currently fail due to missing schema.
Comment on lines +54 to +57
#[cfg(test)]
#[macro_use]
extern crate ctor;

Copy link
Owner

Choose a reason for hiding this comment

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

I think this is not needed.


#[cfg(test)]
mod test {
use ctor;
Copy link
Owner

Choose a reason for hiding this comment

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

Same as this

use std::{env, process::Command};

// Run once before tests are executed.
#[ctor]
Copy link
Owner

@SeaDve SeaDve Feb 8, 2024

Choose a reason for hiding this comment

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

Suggested change
#[ctor]
#[ctor::ctor]

or

use ctor::ctor;

#[ctor]
fn setup_schema() {
    ...
}

],
env: [
'RUST_BACKTRACE=1',
'GSETTINGS_SCHEMA_DIR=@0@/data'.format(meson.project_build_root()),
Copy link
Owner

Choose a reason for hiding this comment

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

This shouldn't be needed too since it is set on setup_schema.

@SeaDve
Copy link
Owner

SeaDve commented Feb 11, 2024

Sorry, btw I haven't given this much focus, I have been really busy in other stuff

@SeaDve
Copy link
Owner

SeaDve commented Feb 11, 2024

Also, not sure what this patch specifically fixes. Is there any particular error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test failure during Arch Linux build
2 participants