Enable linux tests (#12493)

Note:
- We have disabled all tests that rely on Postgres in the Linux CI. We
only really need to test these once, and as macOS is our team's primary
platform, we'll only enable them on macOS for local reproduction.
- We have disabled all tests that rely on the font metrics. We
standardized on Zed Mono in many fonts, but our CoreText Text System and
Cosmic Text System proved to be very different in effect. We should
revisit if we decide to standardize our text system across platforms
(e.g. using Harfbuzz everywhere)
- Extended the condition timeout significantly. Our CI machines are slow
enough that this is causing spurious errors in random tests.

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Mikayla Maki 2024-06-13 16:38:53 -07:00 committed by GitHub
parent 066cdc2297
commit 10d3ad4e33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 107 additions and 52 deletions

View file

@ -1111,14 +1111,11 @@ impl ToDisplayPoint for Anchor {
#[cfg(test)]
pub mod tests {
use super::*;
use crate::{
movement,
test::{editor_test_context::EditorTestContext, marked_display_snapshot},
};
use crate::{movement, test::marked_display_snapshot};
use gpui::{div, font, observe, px, AppContext, BorrowAppContext, Context, Element, Hsla};
use language::{
language_settings::{AllLanguageSettings, AllLanguageSettingsContent},
Buffer, Language, LanguageConfig, LanguageMatcher, SelectionGoal,
Buffer, Language, LanguageConfig, LanguageMatcher,
};
use project::Project;
use rand::{prelude::*, Rng};
@ -1393,6 +1390,7 @@ pub mod tests {
}
}
#[cfg(target_os = "macos")]
#[gpui::test(retries = 5)]
async fn test_soft_wraps(cx: &mut gpui::TestAppContext) {
cx.background_executor
@ -1401,7 +1399,7 @@ pub mod tests {
init_test(cx, |_| {});
});
let mut cx = EditorTestContext::new(cx).await;
let mut cx = crate::test::editor_test_context::EditorTestContext::new(cx).await;
let editor = cx.editor.clone();
let window = cx.window;
@ -1457,39 +1455,39 @@ pub mod tests {
movement::up(
&snapshot,
DisplayPoint::new(DisplayRow(1), 10),
SelectionGoal::None,
language::SelectionGoal::None,
false,
&text_layout_details,
),
(
DisplayPoint::new(DisplayRow(0), 7),
SelectionGoal::HorizontalPosition(x.0)
language::SelectionGoal::HorizontalPosition(x.0)
)
);
assert_eq!(
movement::down(
&snapshot,
DisplayPoint::new(DisplayRow(0), 7),
SelectionGoal::HorizontalPosition(x.0),
language::SelectionGoal::HorizontalPosition(x.0),
false,
&text_layout_details
),
(
DisplayPoint::new(DisplayRow(1), 10),
SelectionGoal::HorizontalPosition(x.0)
language::SelectionGoal::HorizontalPosition(x.0)
)
);
assert_eq!(
movement::down(
&snapshot,
DisplayPoint::new(DisplayRow(1), 10),
SelectionGoal::HorizontalPosition(x.0),
language::SelectionGoal::HorizontalPosition(x.0),
false,
&text_layout_details
),
(
DisplayPoint::new(DisplayRow(2), 4),
SelectionGoal::HorizontalPosition(x.0)
language::SelectionGoal::HorizontalPosition(x.0)
)
);
@ -1679,6 +1677,8 @@ pub mod tests {
);
}
// todo(linux) fails due to pixel differences in text rendering
#[cfg(target_os = "macos")]
#[gpui::test]
async fn test_chunks_with_soft_wrapping(cx: &mut gpui::TestAppContext) {
use unindent::Unindent as _;