Skip to content

Conversation

@RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Sep 10, 2021

Finally got the integration tests working on CI! Turns out that there are a few gotchas... fs events are not really reliable, because if you stream to a file, then the first time you touch the file you immediately get a change even if the file is not finished yet. Instead we now use polling and the awaitWriteFinish options from chokidar with the stabilityThreshold set to a pretty high number to be very sure!

For a few integrations we look at the terminal output (stdout/stderr), and rely on a message like done in, that way we don't have to rely on the extra polling time of the output. This results in faster tests, which is always nice to see. There is a catch though, turns out that webpack-4 and webpack-5 write the successfully compiled in message, before it is fully done writing to disk.

@RobinMalfait RobinMalfait changed the title setup integration tests Setup integration tests Sep 10, 2021
@RobinMalfait RobinMalfait force-pushed the ci-integration-tests branch 2 times, most recently from 6db0e32 to a933b52 Compare September 13, 2021 09:20
If for any reason the integration tests fail, then it will run forever
on CI (~2hours or something). The `--forceExit` is not ideal but it will
prevent long running processes.
We were never properly waiting for the command to finish.
In CI, when an AbortController gets aborted an error is thrown
(AbortError). If we don't catch it properly then it will "leak" and the
test will fail.
@RobinMalfait RobinMalfait force-pushed the ci-integration-tests branch 2 times, most recently from b4e8345 to 904abb9 Compare September 13, 2021 20:22
This will cancel other builds when one fails, it will also separate the
output per integration which can be useful especially now that we are
still figuring things out.
Debouncing for 200ms means that if another message comes in within those
200ms we delay the execution of the callback.
@RobinMalfait RobinMalfait force-pushed the ci-integration-tests branch 2 times, most recently from 608f525 to 4b85cdc Compare September 14, 2021 11:57
@RobinMalfait RobinMalfait merged commit 516ba53 into master Sep 14, 2021
@RobinMalfait RobinMalfait deleted the ci-integration-tests branch September 14, 2021 14:18
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.

2 participants