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

XUnit report shows only autogenerated names for the contexts #674

Closed
nrogachev opened this Issue May 16, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@nrogachev
Copy link

nrogachev commented May 16, 2018

Using the same example package as in #672

This is plain console output is fine, screenshot:
https://www.dropbox.com/s/o13wifh5outok5p/2018-05-16_17h25_28.png?dl=0

But this is how it looks like in Jenkins:
https://www.dropbox.com/s/gtca3bc6flyq5fw/2018-05-16_17h26_22.png?dl=0
https://www.dropbox.com/s/vpatgftl0z8cpbc/2018-05-16_17h26_37.png?dl=0

I'm not sure if it is a reporter issue or a Jenkins issue (our Jenkins is kinda old - 2.58)

@nrogachev

This comment has been minimized.

Copy link
Author

nrogachev commented May 17, 2018

There is also another issue with the auto-generated context names. If you include a test case in the named context then it becomes practically impossible to run a single test case via runner.
Using the same example as above, let's say I want to run single test case test1.
If this test case is not a part of the context then the call would look like that:
ut.run('SCHEMA:de.suit1.TestPkg1.test1')
But if it is in the context then it seems it must be
ut.run('SCHEMA:de.suit1.TestPkg1.context_1.test1')

I think in a big package it can be hard to correctly associate a specific test case with a context number to which it belongs.

@jgebal

This comment has been minimized.

Copy link
Member

jgebal commented Jun 1, 2018

@nrogachev
Thanks for reporting this issue.
I don't have a good idea on how to resolve that.
There is a conflict as:

  • element names (package/procedure/context) cannot have spaces etc.
  • element descriptions should be meaningful and human readable

In current implementation (3.1.0-3.1.1) there is no place to set the name of a context - we can only set description.

Perhaps we should change that and add validation of context names (no spaces)?
So that if you want a description, you would use the description annotation within the context.

Example:

package name_of_the_suite is

--%suite(Description of the suite)

--%beforeall
procedure setup;

--%context(context_name)
--%description(Context Description)

--%test(description of the test)
procedure name_of_the_test;

--%endcontext
end;
/
@jgebal

This comment has been minimized.

Copy link
Member

jgebal commented Jun 1, 2018

Alternatively we could still consider the attribute of context as description and convert spaces to underscores but that could result in very long names, when context have long descriptions.

This also limits the flexibility and prevents from having separate name from description.

@nrogachev

This comment has been minimized.

Copy link
Author

nrogachev commented Jun 1, 2018

@jgebal hi Jacek.
Actually i've already slightly modified the JUnit reporter, and it doesn't seem to have any issues with spaces. I'm basically creating a replacement map and using it in get_path and print_suite_elements. It is probably not the most elegant solution but in my case it seems to be working, i have descriptions in the Jenkins report.
If you want, I can provide you my modification.

But of course it does not help the calling problem (#679).

Speaking of you ideas above, i personally like the first one more.
Maybe it will also make sense to change the suit and test annotations and force putting description for the suite/test in a separate --%description annotation.
By doing so we will have some kind of uniformity:
--%suite - defines package as a test suite (name = package name)
--%description(Nice Suite Description)

--%context(context_name) - analogue to the package name / suit name, if not provided then generated like now "context_1" etc.
--%description(Context Description)

--%test - defines procedure as a test case (name = procedure name)
--%description(Test Case Description)

jgebal added a commit that referenced this issue Jun 7, 2018

Fixed running single test procedure in context by path
Changed context naming (context name can be now explicit)
Context description is now only set from `--%displayname` annotation
Resolves #679
Resolves #674

Fixed most of compiler-warnings

@jgebal jgebal closed this in #695 Jun 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.