on master help sign in
enable rendering in integration tests (#5819)

This will allow testing more of the code base, as well as enable UI- specific testing. Debug mode builds are prohibitively slow for the tests, mostly because of the concurrency write tests. So there is now a profile for integration tests that sets the optimization level to 2 for a few helix crates, and lowers the number of rounds of concurrent writes to 1000.

commitb2e83f81e10089a0e81ce33c4beb51aefc29a62e authorSkyler Hawthorne <skyler@dead10ck.com> dateSat 4 Feb 2023, 16:20 (4 years ago) parentd6e2434
4 files changed+8−6
.cargo/config.toml+1−1 Cargo.toml+6 helix-term/src/application.rs−4 helix-term/tests/test/write.rs+1−1
.cargo/config.toml+1−1
@@ -1,3 +1,3 @@
11[alias]
22xtask = "run --package xtask --"
3−integration-test = "test --features integration --workspace --test integration"
3+integration-test = "test --features integration --profile integration --workspace --test integration"
Cargo.toml+6
@@ -25,3 +25,9 @@ lto = "fat"
2525codegen-units = 1
2626# strip = "debuginfo" # TODO: or strip = true
2727opt-level = 3
28+
29+[profile.integration]
30+inherits = "test"
31+package.helix-core.opt-level = 2
32+package.helix-tui.opt-level = 2
33+package.helix-term.opt-level = 2
helix-term/src/application.rs−4
@@ -277,10 +277,6 @@ impl Application {
277277 Ok(app)
278278 }
279279
280− #[cfg(feature = "integration")]
281− async fn render(&mut self) {}
282−
283− #[cfg(not(feature = "integration"))]
284280 async fn render(&mut self) {
285281 let mut cx = crate::compositor::Context {
286282 editor: &mut self.editor,
helix-term/tests/test/write.rs+1−1
@@ -70,7 +70,7 @@ async fn test_write_quit() -> anyhow::Result<()> {
7070async fn test_write_concurrent() -> anyhow::Result<()> {
7171 let mut file = tempfile::NamedTempFile::new()?;
7272 let mut command = String::new();
73− const RANGE: RangeInclusive<i32> = 1..=5000;
73+ const RANGE: RangeInclusive<i32> = 1..=1000;
7474 let mut app = helpers::AppBuilder::new()
7575 .with_file(file.path(), None)
7676 .build()?;