mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 08:27:25 +00:00
fix(ci): make publication checks runner-safe
This commit is contained in:
@@ -96,7 +96,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Build HTML reader
|
- name: Build HTML reader
|
||||||
env:
|
env:
|
||||||
CHROME_BIN: ${{ steps.setupchrome.outputs.chrome-path }}
|
|
||||||
SAFE_TAG_NAME: ${{ steps.tag.outputs.SAFE_TAG_NAME }}
|
SAFE_TAG_NAME: ${{ steps.tag.outputs.SAFE_TAG_NAME }}
|
||||||
run: |
|
run: |
|
||||||
title=$(python3 -c 'import json; print(json.load(open("book.json", encoding="utf-8"))["title"])')
|
title=$(python3 -c 'import json; print(json.load(open("book.json", encoding="utf-8"))["title"])')
|
||||||
|
|||||||
@@ -114,7 +114,8 @@ class ExampleValidationTests(unittest.TestCase):
|
|||||||
self.assertIn("tools/test_examples.py --require-tools", text)
|
self.assertIn("tools/test_examples.py --require-tools", text)
|
||||||
|
|
||||||
def test_local_run_reports_skips_when_tools_are_unavailable(self):
|
def test_local_run_reports_skips_when_tools_are_unavailable(self):
|
||||||
result = self.run_runner(path="/usr/bin:/bin")
|
with tempfile.TemporaryDirectory() as tmp:
|
||||||
|
result = self.run_runner(path=tmp)
|
||||||
|
|
||||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||||
self.assertEqual(result.stdout.count("SKIP"), 4, result.stdout)
|
self.assertEqual(result.stdout.count("SKIP"), 4, result.stdout)
|
||||||
@@ -124,7 +125,8 @@ class ExampleValidationTests(unittest.TestCase):
|
|||||||
self.assertIn("actionlint", result.stdout)
|
self.assertIn("actionlint", result.stdout)
|
||||||
|
|
||||||
def test_required_run_fails_when_tools_are_unavailable(self):
|
def test_required_run_fails_when_tools_are_unavailable(self):
|
||||||
result = self.run_runner("--require-tools", path="/usr/bin:/bin")
|
with tempfile.TemporaryDirectory() as tmp:
|
||||||
|
result = self.run_runner("--require-tools", path=tmp)
|
||||||
|
|
||||||
self.assertNotEqual(result.returncode, 0)
|
self.assertNotEqual(result.returncode, 0)
|
||||||
self.assertEqual(result.stdout.count("UNAVAILABLE"), 4, result.stdout)
|
self.assertEqual(result.stdout.count("UNAVAILABLE"), 4, result.stdout)
|
||||||
|
|||||||
Reference in New Issue
Block a user