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

crates/oxc_traverse/tests/compile_fail.rs takes too long to test #4537

Closed
Boshen opened this issue May 20, 2024 · 3 comments · Fixed by #4538
Closed

crates/oxc_traverse/tests/compile_fail.rs takes too long to test #4537

Boshen opened this issue May 20, 2024 · 3 comments · Fixed by #4538
Assignees

Comments

@Boshen
Copy link
Member

Boshen commented May 20, 2024

https://github.com/oxc-project/oxc/actions/runs/9161427480/job/25186250402

test compile_fail ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 17.59s

It went through a build process 🤔

Finished dev profile [unoptimized + debuginfo] target(s) in 17.14s

So this test takes 17 seconds in total on windows CI.

@Boshen Boshen self-assigned this May 24, 2024
@Boshen
Copy link
Member Author

Boshen commented Jun 9, 2024

Log:

     Running tests\compile_fail.rs (target\debug\deps\compile_fail-4621d3ad73b6ac38.exe)

running 1 test
    Checking oxc_span v0.13.5 (E:\oxc\crates\oxc_span)
    Checking oxc_index v0.13.5 (E:\oxc\crates\oxc_index)
    Checking oxc_allocator v0.13.5 (E:\oxc\crates\oxc_allocator)
   Compiling oxc_ast_macros v0.13.5 (E:\oxc\crates\oxc_ast_macros)
    Checking oxc_diagnostics v0.13.5 (E:\oxc\crates\oxc_diagnostics)
   Compiling oxc_traverse v0.13.5 (E:\oxc\crates\oxc_traverse)
    Checking oxc_syntax v0.13.5 (E:\oxc\crates\oxc_syntax)
    Checking oxc_ast v0.13.5 (E:\oxc\crates\oxc_ast)
    Checking oxc_semantic v0.13.5 (E:\oxc\crates\oxc_semantic)
    Checking oxc_traverse-tests v0.0.0 (E:\oxc\target\tests\trybuild\oxc_traverse)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.09s


test tests\compile_fail\ancestor_lifetime1.rs ... ok
test tests\compile_fail\ancestor_lifetime2.rs ... ok
test tests\compile_fail\ancestor_lifetime3.rs ... ok


test compile_fail ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.61s

@Boshen
Copy link
Member Author

Boshen commented Jun 9, 2024

Can I vote for removing trybuild tests? 10 seconds is a bit too much for 3 tests :-/

@Boshen Boshen assigned overlookmotel and unassigned Boshen Jun 9, 2024
@overlookmotel overlookmotel transferred this issue from oxc-project/backlog Jul 29, 2024
@overlookmotel
Copy link
Contributor

Fixed in #4538.

overlookmotel added a commit that referenced this issue Jul 29, 2024
Closes #4537.

`oxc_traverse`'s tests to ensure code which would be undefined behavior will not compile were using `trybuild`. This is a thorough way to run these tests, but requires running a lengthy compilation each time tests run.

Implement these tests as `compile_fail` doc tests instead. This is not quite as thorough - now only testing that they don't compile, rather than also *why* they don't compile - but acceptable given the outsized cost of doing it "properly".
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 a pull request may close this issue.

2 participants