Skip to content

Commit bd290f4

Browse files
authored
One pass is sufficient for screenshots; style check on scripts (#902)
* One pass is sufficient for screenshots * check script conventions
1 parent 3af952f commit bd290f4

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

scripts/deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
22

3+
set -euo pipefail
4+
35
die() {
46
printf '%s\n' "$*" >&2
57
exit 1
68
}
79

8-
set -euo pipefail
9-
1010
echo "Check git..."
1111

1212
git pull

scripts/screenshots.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
#!/bin/bash
22

3-
SCREENSHOTS=1 pytest -k test_local_app_downloads -vv
3+
set -euo pipefail
4+
5+
# Test is parameterized: We only need one pass, so download the README.
6+
SCREENSHOTS=1 pytest -k 'test_local_app_downloads and README' -vv

tests/test_misc.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import re
22
import subprocess
33
from pathlib import Path
4+
from stat import S_IXUSR as user_exec_mask
45

56
import pytest
67

@@ -66,6 +67,16 @@ def test_python_min_version(rel_path):
6667
assert not re.search(r"3\.1[^0]", text)
6768

6869

70+
@pytest.mark.parametrize(
71+
"script_path",
72+
(package_root.parent / "scripts").glob("*.sh"),
73+
ids=lambda path: path.name,
74+
)
75+
def test_bash_scripts(script_path: Path):
76+
assert script_path.stat().st_mode & user_exec_mask # type: ignore
77+
assert script_path.read_text().startswith("#!/bin/bash\n\nset -euo pipefail")
78+
79+
6980
def get_file_paths() -> list[Path]:
7081
# TODO: Is there a package that respects .gitignore?
7182
top_level_paths = [

0 commit comments

Comments
 (0)