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.
pull/5822/head^2
Skyler Hawthorne 2 years ago committed by GitHub
parent d6e2434f73
commit b2e83f81e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,3 +1,3 @@
[alias] [alias]
xtask = "run --package xtask --" xtask = "run --package xtask --"
integration-test = "test --features integration --workspace --test integration" integration-test = "test --features integration --profile integration --workspace --test integration"

@ -25,3 +25,9 @@ lto = "fat"
codegen-units = 1 codegen-units = 1
# strip = "debuginfo" # TODO: or strip = true # strip = "debuginfo" # TODO: or strip = true
opt-level = 3 opt-level = 3
[profile.integration]
inherits = "test"
package.helix-core.opt-level = 2
package.helix-tui.opt-level = 2
package.helix-term.opt-level = 2

@ -277,10 +277,6 @@ impl Application {
Ok(app) Ok(app)
} }
#[cfg(feature = "integration")]
async fn render(&mut self) {}
#[cfg(not(feature = "integration"))]
async fn render(&mut self) { async fn render(&mut self) {
let mut cx = crate::compositor::Context { let mut cx = crate::compositor::Context {
editor: &mut self.editor, editor: &mut self.editor,

@ -70,7 +70,7 @@ async fn test_write_quit() -> anyhow::Result<()> {
async fn test_write_concurrent() -> anyhow::Result<()> { async fn test_write_concurrent() -> anyhow::Result<()> {
let mut file = tempfile::NamedTempFile::new()?; let mut file = tempfile::NamedTempFile::new()?;
let mut command = String::new(); let mut command = String::new();
const RANGE: RangeInclusive<i32> = 1..=5000; const RANGE: RangeInclusive<i32> = 1..=1000;
let mut app = helpers::AppBuilder::new() let mut app = helpers::AppBuilder::new()
.with_file(file.path(), None) .with_file(file.path(), None)
.build()?; .build()?;

Loading…
Cancel
Save