Skip to content

Commit

Permalink
fix test name; add failure in perl test report; remove suite
Browse files Browse the repository at this point in the history
  • Loading branch information
shibuiwilliam committed Feb 20, 2023
1 parent 34ab639 commit 33a9f9b
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 57 deletions.
2 changes: 0 additions & 2 deletions launchable/test_runners/perl.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ def find_filename():

# default test path in `subset` expects to have this file name
test_path = [client.make_file_path_component(filepath)]
if suite.name:
test_path.append({"type": "testsuite", "name": suite.name})
if case.name:
test_path.append({"type": "testcase", "name": case.name})
return test_path
Expand Down
64 changes: 29 additions & 35 deletions tests/data/perl/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
"testPath": [
{
"type": "file",
"name": "t/00_compile.t"
},
{
"type": "testsuite",
"name": "t/00_compile.t"
"name": "t/easy/01_easy.t"
},
{
"type": "testcase",
"name": "use Example;"
"name": "a + b = ab"
}
],
"duration": 0.0860052108764648,
"duration": 0.153996229171753,
"status": 1,
"stdout": "",
"stderr": "",
Expand All @@ -27,18 +23,32 @@
"testPath": [
{
"type": "file",
"name": "t/math/01_math.t"
"name": "t/easy/01_easy.t"
},
{
"type": "testsuite",
"type": "testcase",
"name": "str_concat {"
}
],
"duration": 0.00043487548828125,
"status": 1,
"stdout": "",
"stderr": "",
"data": null
},
{
"type": "case",
"testPath": [
{
"type": "file",
"name": "t/math/01_math.t"
},
{
"type": "testcase",
"name": "add(1, 2) == 3"
}
],
"duration": 0.0693521499633789,
"duration": 0.0723011493682861,
"status": 1,
"stdout": "",
"stderr": "",
Expand All @@ -51,16 +61,12 @@
"type": "file",
"name": "t/math/01_math.t"
},
{
"type": "testsuite",
"name": "t/math/01_math.t"
},
{
"type": "testcase",
"name": "add"
}
],
"duration": 0.000168085098266602,
"duration": 0.000227928161621094,
"status": 1,
"stdout": "",
"stderr": "",
Expand All @@ -73,16 +79,12 @@
"type": "file",
"name": "t/math/01_math.t"
},
{
"type": "testsuite",
"name": "t/math/01_math.t"
},
{
"type": "testcase",
"name": "double"
}
],
"duration": 0.000128984451293945,
"duration": 7.91549682617188e-05,
"status": 1,
"stdout": "",
"stderr": "",
Expand All @@ -93,19 +95,15 @@
"testPath": [
{
"type": "file",
"name": "t/easy/01_easy.t"
},
{
"type": "testsuite",
"name": "t/easy/01_easy.t"
"name": "t/math/01_math.t"
},
{
"type": "testcase",
"name": "a + b = ab"
"name": "double_fail"
}
],
"duration": 0.152199029922485,
"status": 1,
"duration": 0.000271081924438477,
"status": 0,
"stdout": "",
"stderr": "",
"data": null
Expand All @@ -115,18 +113,14 @@
"testPath": [
{
"type": "file",
"name": "t/easy/01_easy.t"
},
{
"type": "testsuite",
"name": "t/easy/01_easy.t"
"name": "t/00_compile.t"
},
{
"type": "testcase",
"name": "str_concat {"
"name": "use Example;"
}
],
"duration": 0.000449180603027344,
"duration": 0.0674030780792236,
"status": 1,
"stdout": "",
"stderr": "",
Expand Down
50 changes: 31 additions & 19 deletions tests/data/perl/report.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<?xml version='1.0' encoding='utf-8'?>
<testsuites>
<testsuite name="t/00_compile.t" errors="0" failures="0" skipped="0" tests="1" time="0.0876882076263428">
<system-out>ok 1 - use Example;
1..1
<testsuite name="t/easy/01_easy.t" errors="0" failures="0" skipped="0" tests="2" time="0.157027006149292">
<system-out>ok 1 - a + b = ab
ok 2 - str_concat {
ok 1 - a + dddd
ok 2 - bb + ccc
1..2
}
1..2
</system-out>
<testcase name="use Example;" classname="t/00_compile.t" time="0.0860052108764648" />
<testcase name="a + b = ab" classname="t/easy/01_easy.t" time="0.153996229171753" />
<testcase name="str_concat {" classname="t/easy/01_easy.t" time="0.00043487548828125" />
</testsuite>
<testsuite name="t/math/01_math.t" errors="0" failures="0" skipped="0" tests="3" time="0.0724310874938965">
<testsuite name="t/math/01_math.t" errors="0" failures="1" skipped="0" tests="4" time="0.0786290168762207">
<system-out>ok 1 - add(1, 2) == 3
# Subtest: add
ok 1 - 1 + 2
Expand All @@ -18,22 +24,28 @@ ok 2 - add
ok 2 - 3 + 2
1..2
ok 3 - double
1..3
# Subtest: double_fail
not ok 1 - fail 1 + 2
not ok 2 - fail 3 + 2
1..2
not ok 4 - double_fail
1..4
</system-out>
<testcase name="add(1, 2) == 3" classname="t/math/01_math.t" time="0.0693521499633789" />
<testcase name="add" classname="t/math/01_math.t" time="0.000168085098266602" />
<testcase name="double" classname="t/math/01_math.t" time="0.000128984451293945" />
</testsuite>
<testsuite name="t/easy/01_easy.t" errors="0" failures="0" skipped="0" tests="2" time="0.154859066009521">
<system-out>ok 1 - a + b = ab
ok 2 - str_concat {
ok 1 - a + dddd
ok 2 - bb + ccc
<testcase name="add(1, 2) == 3" classname="t/math/01_math.t" time="0.0723011493682861" />
<testcase name="add" classname="t/math/01_math.t" time="0.000227928161621094" />
<testcase name="double" classname="t/math/01_math.t" time="7.91549682617188e-05" />
<testcase name="double_fail" classname="t/math/01_math.t" time="0.000271081924438477">
<failure message="not ok 4 - double_fail" type="TAP::Parser::Result::Test">Subtest: double_fail
not ok 1 - fail 1 + 2
not ok 2 - fail 3 + 2
1..2
}
1..2
</failure>
</testcase>
</testsuite>
<testsuite name="t/00_compile.t" errors="0" failures="0" skipped="0" tests="1" time="0.0689620971679688">
<system-out>ok 1 - use Example;
1..1
</system-out>
<testcase name="a + b = ab" classname="t/easy/01_easy.t" time="0.152199029922485" />
<testcase name="str_concat {" classname="t/easy/01_easy.t" time="0.000449180603027344" />
<testcase name="use Example;" classname="t/00_compile.t" time="0.0674030780792236" />
</testsuite>
</testsuites>
2 changes: 1 addition & 1 deletion tests/test_runners/test_perl.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tests.cli_test_case import CliTestCase


class GoTestTest(CliTestCase):
class PerlTestTest(CliTestCase):
test_files_dir = Path(__file__).parent.joinpath('../data/perl/').resolve()

@responses.activate
Expand Down

0 comments on commit 33a9f9b

Please sign in to comment.