utPLSQL / utPLSQL-maven-plugin

Maven plugin for running Unit Tests with utPLSQL v3
Apache License 2.0
13 stars 10 forks source link

<reporters> tag is mandatory #28

Closed jgebal closed 5 years ago

jgebal commented 5 years ago

When tag is not provided, plugin should run with default (null) reporter. Null is handled by utPLSQL in database and defaults to UT_DOCUMENTATION_REPORTER We should allow for running with minimal configuration.

jgarec commented 5 years ago

Here's the default behavior in cli : https://github.com/utPLSQL/utPLSQL-cli/blob/7d9c23910c4cb1285fdd776bc7de8088fed87020/src/main/java/org/utplsql/cli/ReporterManager.java#L46-L49

        // If no reporter parameters were passed, use default reporter.
        if (reporterOptionsList.isEmpty()) {
            reporterOptionsList.add(new ReporterOptions(CoreReporters.UT_DOCUMENTATION_REPORTER.name()));
        }
jgebal commented 5 years ago

Might be again reported on oblsolete develop branch. Feel free to close it if it works correctly.

jgarec commented 5 years ago

No i mean this code is in utplsql cli. There is no default value in maven UtPLSQL plugin so we could use the same rule.

jgebal commented 5 years ago

Sounds like a plan

jgebal commented 5 years ago

Wait. I have second thought on this. Shouldn't the client be allowed to abstract from reporter names totally? If so, default should be given by API ehen no reporter defined. Otherwise we will need to duplicate the same behavior in every single client. @pesse - what do you think?

viniciusam commented 5 years ago

Seems like we already assign the documentation reporter by default, on the java-api, if the reporters list is empty: https://github.com/utPLSQL/utPLSQL-java-api/blob/c007ca97c196f9bd1694d03336e74fb161794e3f/src/main/java/org/utplsql/api/TestRunner.java#L139

So maybe we just need to make the reporters tag optional if it's not already. I can check it tonight or over the weekend.

jgebal commented 5 years ago

For some reason it doesn't work

viniciusam commented 5 years ago

The reason we don't get any output, even though we create a new documentation reporter on the API, is that we call ut_runner.run, which does not provide any output. We need to listen for that output using the OutputBuffer as we do in the client. I'm not sure if we should put this behavior as default in the Java API. I will follow what @jgarec was doing on his branch and just create a new documentation reporter if no reporter is specified.

jgebal commented 5 years ago

That will be fine. Othewise we would need to change behavior in API an CLI so that API does that. Not sure if that would fit into current archtecture. Any thoughts @pesse?