RFR: 7903519 : jtreg/jtharness is missing features for basic crash testing [v7]
andrlos
duke at openjdk.org
Tue Dec 19 21:28:59 UTC 2023
On Thu, 14 Dec 2023 14:20:12 GMT, Vladimir Sitnikov <vsitnikov at openjdk.org> wrote:
>> @vlsi I'm partially surprised that you seems to ok to include this change to jtharness. When @andrlos come with the idea I was a bit sceptic. Now I'm curious, do you think jtreg project could harbour some implementations of this interface, and eg produce them as separate jars?
>
>> I'm partially surprised that you seems to ok to include this change to jtharness
>
> Frankly, I am still a bit skeptical, however, the new naming of `StatusTransformer + transform` sounds more-or-less good, and it seems to be the least evil when compared with fully replacing `TestResult` within `Script`.
>
> The suggested PR does not add much maintenance overhead, however, it would probably make sense to add at least one test for it. @andrlos , have you considered adding a test for the feature? Frankly, I have no idea if it would be easy or hard to add a test (I've no idea how tests for jtharness are created), however, it would be great to have one.
>
> Frankly, from a test framework user's point of view, I would prefer something like `TestResult transform(TestResult)` or `testResult.withStatus(newStatus) -> producing new TestResult` or `TestResult.setStatus(newStatus)`.
> However, the latter suggestions might require significant rework of jtreg. Of course, I am nowhere near to asking for such changes.
>
> ----
>
>> Now I'm curious, do you think jtreg project could harbour some implementations of this interface
>
> I am not sure. I know what jtreg is, however, I virtually do not use it, so I can't tell.
@vlsi I was able to make the unit tests run locally in the end, there was an issue with my machine configuration that caused the errors.. I implemented simple unit test for Script behavior, however it does not test the usage of the services.. to test it completely I would have to modify the jar midexecution with new custom META-INF and it somehow feels wrong hardcoding the relative path to the javatest.jar into the unit test itself.. the other idea that came to mind was to just not test the service lookup but just the implementation usage, however for this I would need to make the `loadStatusTransformer` function not `static` and `protected` instead of `private`. WDYT?
-------------
PR Comment: https://git.openjdk.org/jtharness/pull/57#issuecomment-1863493810
More information about the jtharness-dev
mailing list