Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve testing with stats and errors per test section #498

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions pkl-cli/src/test/kotlin/org/pkl/cli/CliTestRunnerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ class CliTestRunnerTest {
assertThat(out.toString().stripFileAndLines(tempDir))
.isEqualTo(
"""
module test
succeed ✅
module test ✅ 100.0% pass [1 passed]
facts ✅ 100.0% pass [1 passed]
succeed ✅ 100.0% pass [2 passed]

"""
.trimIndent()
Expand All @@ -80,7 +81,7 @@ class CliTestRunnerTest {
facts {
["fail"] {
4 == 9
"foo" == "bar"
"foo" != "bar"
}
}
"""
Expand All @@ -96,10 +97,10 @@ class CliTestRunnerTest {
assertThat(out.toString().stripFileAndLines(tempDir))
.isEqualTo(
"""
module test
fail ❌
4 == 9 ❌
"foo" == "bar"
module test ❌ 0.0% pass [0 passed, 1 failed]
facts ❌ 0.0% pass [0 passed, 1 failed]
fail ❌ 50.0% pass [1 passed, 1 failed]
4 == 9

"""
.trimIndent()
Expand All @@ -118,7 +119,8 @@ class CliTestRunnerTest {
9 == trace(9)
"foo" == "foo"
}
["fail"] {
["bar"] {
"foo" == "foo"
5 == 9
}
}
Expand All @@ -136,8 +138,8 @@ class CliTestRunnerTest {
"""
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="test" tests="2" failures="1">
<testcase classname="test" name="foo"></testcase>
<testcase classname="test" name="fail">
<testcase classname="test.facts" name="foo"></testcase>
<testcase classname="test.facts" name="bar">
<failure message="Fact Failure">5 == 9 ❌</failure>
</testcase>
<system-err><![CDATA[9 = 9
Expand Down
Loading