File tree 6 files changed +20
-5
lines changed
static/images/guides/build/projects-and-components/components
examples/docs_beta_snippets
docs_beta_snippets_tests/snippet_checks
6 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ sphinx_objects_inv:
32
32
regenerate_cli_snippets :
33
33
cd ../examples/docs_beta_snippets && tox -e docs_snapshot_update && echo " \nSnippets regenerated!"
34
34
35
+ regenerate_cli_snippets_and_screenshots :
36
+ cd ../examples/docs_beta_snippets && EXTRA_PARAMS=' --update-screenshots' tox -e docs_snapshot_update && echo " \nSnippets regenerated!"
37
+
35
38
regenerate_cli_snippets_and_test :
36
39
cd ../examples/docs_beta_snippets && tox -e docs_snapshot_update && tox -e docs_snapshot_test && echo " \nSnippets regenerated and tested!"
37
40
Original file line number Diff line number Diff line change @@ -8,13 +8,22 @@ def pytest_addoption(parser: pytest.Parser) -> None:
8
8
"--update-snippets" ,
9
9
action = "store_true" ,
10
10
)
11
+ parser .addoption (
12
+ "--update-screenshots" ,
13
+ action = "store_true" ,
14
+ )
11
15
12
16
13
17
@pytest .fixture
14
18
def update_snippets (request : pytest .FixtureRequest ) -> bool :
15
19
return bool (request .config .getoption ("--update-snippets" ))
16
20
17
21
22
+ @pytest .fixture
23
+ def update_screenshots (request : pytest .FixtureRequest ) -> bool :
24
+ return bool (request .config .getoption ("--update-screenshots" ))
25
+
26
+
18
27
@pytest .fixture (scope = "session" )
19
28
def get_selenium_driver ():
20
29
from selenium import webdriver
Original file line number Diff line number Diff line change 29
29
)
30
30
31
31
32
- def test_components_docs_index (update_snippets : bool , get_selenium_driver ) -> None :
32
+ def test_components_docs_index (
33
+ update_snippets : bool , update_screenshots : bool , get_selenium_driver
34
+ ) -> None :
33
35
snip_no = 0
34
36
35
37
def next_snip_no ():
@@ -130,7 +132,7 @@ def next_snip_no():
130
132
/ "projects-and-components"
131
133
/ "components"
132
134
/ "component-type-docs.png" ,
133
- update_snippets = update_snippets ,
135
+ update_screenshots = update_screenshots ,
134
136
)
135
137
136
138
#########################################################
Original file line number Diff line number Diff line change @@ -286,11 +286,11 @@ def screenshot_page(
286
286
get_webdriver : "Callable[[], webdriver.Chrome]" ,
287
287
url : str ,
288
288
path : Path ,
289
- update_snippets : bool ,
289
+ update_screenshots : bool ,
290
290
width : Optional [int ] = 1024 ,
291
291
height : Optional [int ] = 768 ,
292
292
) -> None :
293
- if not update_snippets :
293
+ if not update_screenshots :
294
294
return
295
295
webdriver = get_webdriver ()
296
296
webdriver .set_window_size (width , height )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ passenv =
8
8
COVERALLS_REPO_TOKEN
9
9
POSTGRES_TEST_DB_HOST
10
10
BUILDKITE*
11
+ EXTRA_PARAMS
11
12
install_command = uv pip install {opts} {packages}
12
13
deps =
13
14
duckdb
@@ -92,4 +93,4 @@ commands =
92
93
docs_snapshot_test: sh ./docs_beta_snippets_tests/ensure_snapshot_deps.sh
93
94
docs_snapshot_test: pytest -c ../../pyproject.toml -vv {posargs} docs_beta_snippets_tests/snippet_checks
94
95
docs_snapshot_update: sh ./docs_beta_snippets_tests/ensure_snapshot_deps.sh
95
- docs_snapshot_update: pytest -c ../../pyproject.toml -vv {posargs} docs_beta_snippets_tests/snippet_checks --update-snippets
96
+ docs_snapshot_update: pytest -c ../../pyproject.toml -vv {posargs} docs_beta_snippets_tests/snippet_checks --update-snippets {env:EXTRA_PARAMS}
You can’t perform that action at this time.
0 commit comments