1
0
Fork 0
mirror of https://github.com/helix-editor/helix synced 2024-04-20 05:33:51 +02:00

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
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View File

@ -1,3 +1,3 @@
[alias]
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
# strip = "debuginfo" # TODO: or strip = true
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 @@ pub fn new(
Ok(app)
}
#[cfg(feature = "integration")]
async fn render(&mut self) {}
#[cfg(not(feature = "integration"))]
async fn render(&mut self) {
let mut cx = crate::compositor::Context {
editor: &mut self.editor,

View File

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