Skip to content

No debug output in online editor anymore #108

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

Closed
2 tasks done
mk-mxp opened this issue Apr 26, 2024 · 1 comment · Fixed by #109
Closed
2 tasks done

No debug output in online editor anymore #108

mk-mxp opened this issue Apr 26, 2024 · 1 comment · Fixed by #109
Assignees

Comments

@mk-mxp
Copy link
Contributor

mk-mxp commented Apr 26, 2024

Since #105 there is no user output (echo or var_dump()) forwarded to the online editor results. There is no test for that, so it wasn't catched in advance.

  • Add a test for user output
  • Make it possible again to have the output in the results

I also got that feedback from a collegue on CLI. Maybe PHPUnit needs to be configured accordingly?

@mk-mxp mk-mxp self-assigned this Apr 26, 2024
@mk-mxp
Copy link
Contributor Author

mk-mxp commented Apr 27, 2024

Investigation:

  • The problem is not present for students using the CLI. Nothing changed for them.
  • PHPUnit decided to remove <system-out> from JUnit for PHPUnit V10+. There is no replacement.
  • It is not possible to suppress all PHPUnit output and let user output shown up. The reason is, that PHPUnit captures all output and controls showing it with its own output creation.
  • It is possible to mark tests, that produce output, as failed (--disallow-test-output --fail-on-risky).
  • JUnit log file doesn't contain these as failed: <testsuite name="HelloWorldTest" [...] tests="1" assertions="1" errors="0" failures="0" skipped="0" time="0.007922">
  • Teamcity log file does contain these tests, but the file must be parsed additionally (| is escape char): ##teamcity[testFailed name='testHelloWorld' message='This test printed output: My |'User üâ|||| output|'|n\Some backslash|nobject(stdClass)#79 (0) {|n}|n' details='' duration='6' flowId='6893']

Conclusion:

  • Write additional Teamcity log file during test run
  • Add Teamcity log file parsing to junit-handler
  • Provide user output from Teamcity log file in JSON result file as expected for V3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant