From 768615657146ad204d0da356526ce12a44b49a19 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 18 Jun 2024 11:00:10 +0100 Subject: [PATCH 1/2] github: Publish test results This annotates the source location when a check fails, and adds a comment if at least one test has failed. https://phabricator.endlessm.com/T35508 --- .github/workflows/checks.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index a88a41a4..2bc45c00 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -24,6 +24,9 @@ jobs: tests: name: Tests runs-on: ubuntu-latest + permissions: + checks: write + pull-requests: write steps: - name: Checkout uses: actions/checkout@v4 @@ -37,4 +40,11 @@ jobs: godot --path . --headless --import - name: Run tests run: | - godot --path . --headless --script addons/gut/gut_cmdln.gd -gexit + godot --path . --headless --script addons/gut/gut_cmdln.gd -gjunit_xml_file=test-report.xml -gexit + - name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + files: test-report.xml + comment_mode: failures + test_file_prefix: "-res://" From a09090caf265230c0f2b99327c8e74e6202e18a6 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 18 Jun 2024 11:06:35 +0100 Subject: [PATCH 2/2] DO NOT MERGE --- tests/test_instruction_tree.gd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_instruction_tree.gd b/tests/test_instruction_tree.gd index d42ddcbc..725a0ed5 100644 --- a/tests/test_instruction_tree.gd +++ b/tests/test_instruction_tree.gd @@ -65,3 +65,7 @@ func test_tree_node_text(): var text: String = tree.generate_text(root, 0) assert_eq(text, "root\n\tchild1\n\t\tgrandchild\n\tchild2\nsibling\n\tnephew\n") + + +func test_error(): + assert_eq("a", "b")