-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update handling of result files #21
Open
pclausen
wants to merge
5
commits into
exercism:main
Choose a base branch
from
pclausen:fix-results
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
for exp_res in $(find . -name expected_results.json); do | ||
res=$(echo $exp_res | sed 's/expected_//') | ||
cmd="diff $res $exp_res" | ||
echo $cmd | ||
$cmd | ||
echo | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
for exp_res in $(find . -name expected_results.json); do | ||
res=$(echo $exp_res | sed 's/expected_//') | ||
cmd="cp $res $exp_res" | ||
echo $cmd | ||
$cmd | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,152 @@ | ||
{ | ||
"tests": [ | ||
{ "name" : "Test 1: stating something", | ||
"status": "fail" } | ||
, | ||
{ "name" : "Test 2: shouting", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 3: shouting gibberish", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 4: asking a question", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 5: asking a numeric question", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 6: asking gibberish", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 7: talking forcefully", | ||
"status": "fail" } | ||
, | ||
{ "name" : "Test 8: using acronyms in regular speech", | ||
"status": "fail" } | ||
, | ||
{ "name" : "Test 9: forceful question", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 10: shouting numbers", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 11: no letters", | ||
"status": "fail" } | ||
, | ||
{ "name" : "Test 12: question with no letters", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 13: shouting with special characters", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 14: shouting with no exclamation mark", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 15: statement containing question mark", | ||
"status": "fail" } | ||
, | ||
{ "name" : "Test 16: non-letters with question", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 17: prattling on", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 18: silence", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 19: prolonged silence", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 20: multiple line question", | ||
"status": "fail" } | ||
, | ||
{ "name" : "Test 21: starting with whitespace", | ||
"status": "fail" } | ||
, | ||
{ "name" : "Test 22: ending with whitespace", | ||
"status": "pass" } | ||
, | ||
{ "name" : "Test 23: non-question ending with whitespace", | ||
"status": "fail" } | ||
{ | ||
"name" : "Test 1: stating something", | ||
"test_code": "Test 1: stating something", | ||
"status" : "fail", | ||
"message" : "Expected < Whatever. > but got < Whatever. THIS IS A FAILING TEST >" | ||
} | ||
, | ||
{ | ||
"name" : "Test 2: shouting", | ||
"test_code": "Test 2: shouting", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 3: shouting gibberish", | ||
"test_code": "Test 3: shouting gibberish", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 4: asking a question", | ||
"test_code": "Test 4: asking a question", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 5: asking a numeric question", | ||
"test_code": "Test 5: asking a numeric question", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 6: asking gibberish", | ||
"test_code": "Test 6: asking gibberish", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 7: talking forcefully", | ||
"test_code": "Test 7: talking forcefully", | ||
"status" : "fail", | ||
"message" : "Expected < Whatever. > but got < Whatever. THIS IS A FAILING TEST >" | ||
} | ||
, | ||
{ | ||
"name" : "Test 8: using acronyms in regular speech", | ||
"test_code": "Test 8: using acronyms in regular speech", | ||
"status" : "fail", | ||
"message" : "Expected < Whatever. > but got < Whatever. THIS IS A FAILING TEST >" | ||
} | ||
, | ||
{ | ||
"name" : "Test 9: forceful question", | ||
"test_code": "Test 9: forceful question", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 10: shouting numbers", | ||
"test_code": "Test 10: shouting numbers", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 11: no letters", | ||
"test_code": "Test 11: no letters", | ||
"status" : "fail", | ||
"message" : "Expected < Whatever. > but got < Whatever. THIS IS A FAILING TEST >" | ||
} | ||
, | ||
{ | ||
"name" : "Test 12: question with no letters", | ||
"test_code": "Test 12: question with no letters", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 13: shouting with special characters", | ||
"test_code": "Test 13: shouting with special characters", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 14: shouting with no exclamation mark", | ||
"test_code": "Test 14: shouting with no exclamation mark", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 15: statement containing question mark", | ||
"test_code": "Test 15: statement containing question mark", | ||
"status" : "fail", | ||
"message" : "Expected < Whatever. > but got < Whatever. THIS IS A FAILING TEST >" | ||
} | ||
, | ||
{ | ||
"name" : "Test 16: non-letters with question", | ||
"test_code": "Test 16: non-letters with question", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 17: prattling on", | ||
"test_code": "Test 17: prattling on", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 18: silence", | ||
"test_code": "Test 18: silence", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 19: prolonged silence", | ||
"test_code": "Test 19: prolonged silence", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 20: multiple line question", | ||
"test_code": "Test 20: multiple line question", | ||
"status" : "fail", | ||
"message" : "Expected < Whatever. > but got < Whatever. THIS IS A FAILING TEST >" | ||
} | ||
, | ||
{ | ||
"name" : "Test 21: starting with whitespace", | ||
"test_code": "Test 21: starting with whitespace", | ||
"status" : "fail", | ||
"message" : "Expected < Whatever. > but got < Whatever. THIS IS A FAILING TEST >" | ||
} | ||
, | ||
{ | ||
"name" : "Test 22: ending with whitespace", | ||
"test_code": "Test 22: ending with whitespace", | ||
"status" : "pass", | ||
} | ||
, | ||
{ | ||
"name" : "Test 23: non-question ending with whitespace", | ||
"test_code": "Test 23: non-question ending with whitespace", | ||
"status" : "fail", | ||
"message" : "Expected < Whatever. > but got < Whatever. THIS IS A FAILING TEST >" | ||
} | ||
], | ||
"version": 2, | ||
"status": "fail" | ||
"status" : "fail" | ||
"message": "Test summary: 8 of 23 tests failed", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you've now stripped the newlines entirely, which is not what we want I think :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, only for the test case. I moved the the "stripping" of newlines etc from run.sh to run-test.sh. Thus, for the "real" case using "run.sh" we will have newlines and line numbers etc.
Maybe this whole stripping of the json file makes the test meaningless, but my problem is that the errors are different within docker vs local execution. If you have a suggestion for a better solution I would be very happy to implement it if its within my ability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. The main concern I have with that is that the expected result files no longer exactly indicate what is shown to the student. We'd thus never know for certain whether what's displayed to the student is the correct value.
If you'd like me to take a look, I'd be happy to of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ErikSchierboom I agree and i would like if you could have a look. My main problem is that I do not know docker well enough to know if there is a way to make it behave more like the "normal" linux system. If the two systems behaved the same, these stripping of results would not be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docker should actually behave lik a normal linux system. I'll take a look.