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.
This commit is contained in:
Skyler Hawthorne 2023-02-04 16:20:23 -05:00 committed by GitHub
parent d6e2434f73
commit b2e83f81e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View file

@ -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"

View file

@ -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

View file

@ -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,

View file

@ -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()?;