Skip to content

Commit

Permalink
Improve test performance by reducing and finetuning the Webpack build…
Browse files Browse the repository at this point in the history
… tests (#1713) (#1715)
  • Loading branch information
bartfeenstra authored Jul 16, 2024
1 parent 87e457e commit 13076d3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions betty/tests/extension/webpack/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,22 @@ class TestBuilder:
(
"with_entry_point_provider",
"debug",
"npm_install_cache_available",
"webpack_build_cache_available",
),
# Testing without debugging mode and without any caches is done by TestDemoServer.
[
(True, True, True, True),
(False, True, True, True),
(True, False, True, True),
(True, True, True, False),
# Without an entry point provider.
(False, False, True),
# With debug.
(False, True, True),
# With the npm install cache, but without the Webpack cache.
(False, False, False),
],
)
async def test_build(
self,
with_entry_point_provider: bool,
debug: bool,
npm_install_cache_available: bool,
tmp_path: Path,
webpack_build_cache_available: bool,
) -> None:
Expand All @@ -65,10 +66,9 @@ async def test_build(
job_context=job_context,
localizer=DEFAULT_LOCALIZER,
)
if npm_install_cache_available:
webpack_build_directory_path = await sut.build()
if not webpack_build_cache_available:
await to_thread(rmtree, webpack_build_directory_path)
webpack_build_directory_path = await sut.build()
if not webpack_build_cache_available:
await to_thread(rmtree, webpack_build_directory_path)
webpack_build_directory_path = await sut.build()
assert (webpack_build_directory_path / "css" / "vendor.css").exists()
assert (
Expand Down

0 comments on commit 13076d3

Please sign in to comment.