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

Update handling of result files #21

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ ports:
onOpen: open-preview

# List the start up tasks. You can start them in parallel in multiple terminals. See https://www.gitpod.io/docs/config-start-tasks/
tasks:
- command: echo 'Create build directory and run build and test' && mkdir build && cd build && cmake .. && make && ctest -V && cd ..
#tasks:
# - command: echo 'Create build directory and run build and test' && mkdir -p build && cd build && cmake .. && make && ctest -V && cd ..
9 changes: 9 additions & 0 deletions bin/diff_expected_results.sh
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
2 changes: 1 addition & 1 deletion tests/example-empty-file/expected_results.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"version": 2,
"status": "error",
"tests": [],
"message": "/tmp/example-empty-file/example_empty_file_test.f:::\\\\n\\\\n | use bob\\\\n | \\\\nFatal Error: Cannot open module file bob.mod for reading at (): No such file or directory\\\\ncompilation terminated.\\\\nmake[]: *** [CMakeFiles/example-empty-file.dir/build.make:: CMakeFiles/example-empty-file.dir/example_empty_file_test.f.o] Error \\\\nmake[]: *** [CMakeFiles/Makefile:: CMakeFiles/example-empty-file.dir/all] Error \\\\nmake: *** [Makefile:: all] Error \\\\n"
"message": "/tmp/example-empty-file/example_empty_file_test.f::: | use bob | Fatal Error: Cannot open module file bob.mod for reading at (): No such file or directorycompilation terminated.make[]: *** [CMakeFiles/example-empty-file.dir/build.make:: CMakeFiles/example-empty-file.dir/example_empty_file_test.f.o] Error make[]: *** [CMakeFiles/Makefile:: CMakeFiles/example-empty-file.dir/all] Error make: *** [Makefile:: all] Error "
Copy link
Member

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 :)

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

}
2 changes: 1 addition & 1 deletion tests/example-syntax-error/expected_results.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"version": 2,
"status": "error",
"tests": [],
"message": "/tmp/example-syntax-error/example_syntax_error.f:::\\\\n\\\\n | function hey(statement_THIS_IS_A_SYNTAX_ERROR)\\\\n | \\\\nError: Symbol statement_this_is_a_syntax_error at () has no IMPLICIT type\\\\n/tmp/example-syntax-error/example_syntax_error.f:::\\\\n\\\\n | character(len=*), intent(in) :: statement\\\\n | \\\\nError: Symbol at () is not a DUMMY variable\\\\nmake[]: *** [CMakeFiles/example-syntax-error.dir/build.make:: CMakeFiles/example-syntax-error.dir/example_syntax_error.f.o] Error \\\\nmake[]: *** [CMakeFiles/Makefile:: CMakeFiles/example-syntax-error.dir/all] Error \\\\nmake: *** [Makefile:: all] Error \\\\n"
"message": "/tmp/example-syntax-error/example_syntax_error.f::: | function hey(statement_THIS_IS_A_SYNTAX_ERROR) | Error: Symbol statement_this_is_a_syntax_error at () has no IMPLICIT type/tmp/example-syntax-error/example_syntax_error.f::: | character(len=*), intent(in) :: statement | Error: Symbol at () is not a DUMMY variablemake[]: *** [CMakeFiles/example-syntax-error.dir/build.make:: CMakeFiles/example-syntax-error.dir/example_syntax_error.f.o] Error make[]: *** [CMakeFiles/Makefile:: CMakeFiles/example-syntax-error.dir/all] Error make: *** [Makefile:: all] Error "
}