mbeckerle commented on issue #17:
URL: https://github.com/apache/daffodil-sbt/issues/17#issuecomment-1908852052
I depend on having a line of scala code that I can click on and say "debug",
with breakpoints set in layers, UDFs or other code artifacts of the schema.
Using Li Haoyi's sourcecode library I was able to create this kind of test
line:
```
@Test def test_test01(): Unit = go
```
The go function uses the sourcecode library which reflects on the method
name, "test_" if present is stripped off leaving just the "test01" which is
then used as a TDML test case name.
I also really like doing
```
@Test def test_test01(): Unit = runner.trace.runOneTest("test01")
```
That turns on the trace mode of the debugger. I find most schema bugs this
way.
Both techniques could be combined to eliminate the redundancy of test case
names, as well as providing the trace behavior.
Last point: We frequently find a bug, create TDML tests for it, then do:
```
// DAFFODIL-XYZY
// @Test def test_test01(): Unit = runner.runOneTest("test01")
```
so that we can commit and merge a test that illustrates the bug, but doesn't
run, so it doesn't break the build.
I really like this split where you can add a test independently of creating,
or even designing or thinking about, the fix.
This could be achieved by some technique of editing the TDML file however.
Worst case commenting the whole test out and putting the JIRA ticket ID into
the comment.
I do think there is some divergence of TDML files and the scala driver files
at this point. Many tests appear to be present in the TDML which are never
exercised by the scala driver files. This can be confusing. Tests in TDML with
associated schemas can seem to contradict the DFDL spec, and only subsequently
do you find out those TDML tests are not being used any more.
Actual suggestion/idea:
What if the scala driver files are generated from the TDML when needed? Like
sbt testGen creates the test driver in test/src_managed, but this is manually
invoked by developers who want the drivers so they can easily trace or debug
just one test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]