-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic @next/font/google integration test #3170
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
9 Ignored Deployments
|
1abb7f5
to
72328f9
Compare
72328f9
to
2569879
Compare
crates/next-dev/tests/integration.rs
Outdated
if font_dir.exists() { | ||
let server = create_font_server(&font_dir); | ||
env::set_var( | ||
"TURBOPACK_TEST_ONLY_GOOGLE_FONTS_STYLESHEET_URL", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be okay with the way cargo test
/cargo nexttest
run tests in parallel, with multiple threads but only one test running in serial within the thread (see unsetting this value below)
🟢 CI successful 🟢Thanks |
Benchmark for 32f99d1Click to view benchmark
|
...t/font-google/basic/__google_fonts__/css2?family=Inter:ital,wght@0,100..900&display=optional
Outdated
Show resolved
Hide resolved
2569879
to
dab5e26
Compare
Benchmark for 49633dc
Click to view full benchmark
|
dab5e26
to
c4b4899
Compare
Benchmark for 690d299Click to view benchmark
|
Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
c4b4899
to
4fe7fcc
Compare
Benchmark for becd4c6
Click to view full benchmark
|
Benchmark for 7bc2b92
Click to view full benchmark
|
@alexkirsz it looks like this test caught a regression from #3184, which made the next-font transform no longer run. |
This: * Implements a basic http server to mock returning a stylesheet from the Google Fonts API (**Note**: This importantly does *not* mock returning the font resources themselves, which are currently loaded by the browser. We should implement something to do this when we implement caching arbitrary http resources traced from `url()` and this is no longer loaded by the test browser) * Adds an integration test that asserts the basic shape of the JS object returned by font functions * ~Adds an integration test that asserts the browser correctly loads a font for the ascii unicode range, along with the appropriate `font-display`, variant, etc.~ Unfortunately `document.fonts` is not reliable with different font-display loading patterns as any of them can fall back. As noted, this does not mock responses from Google for the font resources themselves, which are currently loaded by the test browser. This means that we'll be dependent on this external service for passing integration tests until we implement caching of `url()`s in Turbopack. We should monitor the reliability of this test.
This: * Implements a basic http server to mock returning a stylesheet from the Google Fonts API (**Note**: This importantly does *not* mock returning the font resources themselves, which are currently loaded by the browser. We should implement something to do this when we implement caching arbitrary http resources traced from `url()` and this is no longer loaded by the test browser) * Adds an integration test that asserts the basic shape of the JS object returned by font functions * ~Adds an integration test that asserts the browser correctly loads a font for the ascii unicode range, along with the appropriate `font-display`, variant, etc.~ Unfortunately `document.fonts` is not reliable with different font-display loading patterns as any of them can fall back. As noted, this does not mock responses from Google for the font resources themselves, which are currently loaded by the test browser. This means that we'll be dependent on this external service for passing integration tests until we implement caching of `url()`s in Turbopack. We should monitor the reliability of this test.
This:
url()
and this is no longer loaded by the test browser)Adds an integration test that asserts the browser correctly loads a font for the ascii unicode range, along with the appropriateUnfortunatelyfont-display
, variant, etc.document.fonts
is not reliable with different font-display loading patterns as any of them can fall back.As noted, this does not mock responses from Google for the font resources themselves, which are currently loaded by the test browser. This means that we'll be dependent on this external service for passing integration tests until we implement caching of
url()
s in Turbopack. We should monitor the reliability of this test.