-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add base for GUI tests #2476
base: master
Are you sure you want to change the base?
Add base for GUI tests #2476
Conversation
a3f8cd0
to
1a2991f
Compare
ef31501
to
4b48db3
Compare
Finally fixed windows build. :') |
This comment was marked as resolved.
This comment was marked as resolved.
4b48db3
to
3ef8841
Compare
Great idea, thanks! Updated. |
3ef8841
to
3edbe33
Compare
CONTRIBUTING.md
Outdated
cargo test --test gui -- --disable-headless-test | ||
``` | ||
|
||
You can find the `browser-ui-test` package documentation on [its repository](https://github.com/GuillaumeGomez/browser-UI-test/blob/master/goml-script.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing a lot of information on how those are written. Something like this?
The GUI tests are in the directory
tests/gui
in text files with the.goml
extension. These tests are run using a node.js program calledbrowser-ui-test
. You can find documentation for this language on its repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, thanks! Hard to know what is missing when you're too involved in something. ^^'
3edbe33
to
7ba47be
Compare
.github/workflows/main.yml
Outdated
- name: Build and run tests (+ GUI) | ||
if: matrix.os != 'windows-latest' | ||
run: cargo test --locked --target ${{ matrix.target }} --test gui | ||
- name: Build and run tests | ||
if: matrix.os == 'windows-latest' | ||
run: cargo test --locked --target ${{ matrix.target }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to disable the default tests on non-windows runners. cargo test --locked --target ${{ matrix.target }} --test gui
only runs the GUI tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah indeed! Good catch.
b2c148a
to
a265652
Compare
a265652
to
2a13ca2
Compare
.github/workflows/main.yml
Outdated
run: npm install browser-ui-test@"${BROWSER_UI_TEST_VERSION}" | ||
- name: Build and run tests (+ GUI) | ||
if: matrix.os != 'windows-latest' | ||
run: cargo test --locked --target ${{ matrix.target }} --test gui | ||
- name: Build and run tests | ||
run: cargo test --locked --target ${{ matrix.target }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I removed the if
condition, the GUI test is now failing on linux. I have no clue what's going since the output seems to not be present for unknown reasons...
b59a123
to
2a13ca2
Compare
Is there a way to still have all CIs run even if one failed? |
43b3821
to
6c48bd6
Compare
f1aa997
to
1cb0996
Compare
So GUI command is failing, but can't figure out why since there is no output. It's super weird. |
tests/gui/runner.rs
Outdated
|
||
// Then we run the GUI tests on it. | ||
let status = command.status().expect("failed to get command output"); | ||
assert!(status.success()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert!(status.success()); | |
assert!(status.success(), "{status:?}",); |
This should give us a little more information.
1cb0996
to
cc8ce35
Compare
|
||
let mut command = Command::new("npx"); | ||
command | ||
.arg("browser-ui-test") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lacking anything else to try...
.arg("browser-ui-test") | |
.arg("browser-ui-test") | |
.args(["--debug", "--jobs", "1"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error: Failed to launch the browser process!
[8316:8316:1219/155437.724812:FATAL:zygote_host_impl_linux.cc(126)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
Okay, then. Looks like the solution is to turn off the sandbox (at least in CI, which is already isolated into containers).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to rustfmt this file. Tabs aren't used for indentation here.
766535e
to
22d2b30
Compare
22d2b30
to
69ef52f
Compare
CI passed! \o/ Thanks so much @notriddle ! |
As discussed with @ehuss, this PR adds the basics for adding more GUI tests. Just add more
.goml
files in thetests/gui
folder.This is the same GUI test framework used in rustdoc and docs.rs.
If you need any explanation on how it works, or if you have any question, please don't hesitate to ask.