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

Implement Trace functionality for CLI TDML test #1047

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

olabusayoT
Copy link
Contributor

  • fix bug with debugger where we were casting the data processor instead of the debugger

Note, we were unable to test the trace output using CLI tests as the trace output wasn't able to be found using CLI.expect. My guess is it has something to do with output being sent to a PipedOutputStream, which may be different from System.out of the other output.

DAFFODIL-2694

Copy link
Contributor

@mbeckerle mbeckerle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Assert.usage(dp ne null)
val d = dp.asInstanceOf[Debugger]
Assert.usage(db ne null)
val d = db.asInstanceOf[Debugger]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow. What a bug.

We should disallow use of tiny value names like dp and db and spell things out a little more I think.

db here is a parameter name. That one should definitely be spelled out as 'debugger'.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that code cov says this wasn't a bug, because it's not called.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I noticed the bug while working on getting the -d functionality to work with "test", it gets called then. This changeset doesn't have that functionality work, but it felt wrong to leave the bug

@olabusayoT
Copy link
Contributor Author

I was able to fix the debug functionality and added a cli test to confirm it is working

@olabusayoT olabusayoT force-pushed the daf-2694-cli-test-trace branch 3 times, most recently from a8e89c0 to 15c46c6 Compare July 12, 2023 18:49
Copy link
Contributor

@mbeckerle mbeckerle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

- fix bug with debugger where we were casting the data processor as an instance of the Debugger instead of the passed in debugger
- fix DAFFODIL-2833 by using TraceDebuggerRunner instead of TDMLRunner.trace
- set areDebuggingFlag when a debugger is set with withDebugger
- add debug.txt to rat excludes

DAFFODIL-2694 DAFFODIL-2833
@olabusayoT olabusayoT merged commit 81de170 into apache:main Jul 12, 2023
10 checks passed
@olabusayoT olabusayoT deleted the daf-2694-cli-test-trace branch July 12, 2023 22:18
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 this pull request may close these issues.

3 participants