-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add support for multiple servers in JIRA Governor Extension #22
Comments
Implemening that would not be a trivial task. In order to contact some Jira server, you have to provide credentials in arquillian.xml. So you would have to abstract whole extension to deal with multiple Jira servers from the configuration point of view and you would need to put them in some registry and dynamically switch between them. |
I have looked into the code and infrastructure-wise the code is ready. There is good abstraction of The only thing is to implement parsing of multiple Jira servers in configration from the If you figure out how to configure multiple |
My proposal is this:
So you would have to do it like this:
If you use it like this:
What do you think? |
Maybe it could be done with annotations as well. The same way you put
and after that:
and another one:
You would have to have extensions with names "governor-jira-community" and "governor-jira-production". In other words, lowercased server annotation would equal to suffix in respective extension qualifier in arquillian.xml. The same approach is used in Arquillian Drone with Drone qualifiers. So you would do:
The problem is what server would be contacted if you do not put any I do not know if this is reasonably implementable yet but it does make sense to me. |
My next feature request will be to support defining of multiple issues for one test. Possible solutions: @Jira({"A-1","B-1"}) B) @Jiras({
@Jira("A-1"),
@Jira("B-1")
}) How to define server definition here? Special annotation will not work if component "A" and "B" are on different servers. So I would prefer the solution B with optional parameter, e.g. Possible solution: @Jiras({
@Jira(id="A-1", server="community"),
@Jira(id="B-1", server="production")
}) The most generic solution I would like :-) @Issues({
@Jira(id="A-1", server="jira-community"),
@Jira(id="B-1", server="jira-production"),
@Bugzilla(id="C-1"),
@Github(id="D-1"),
@Gitlab(id="E-1")
}) If there are more possible servers I would check that server parameter must be set. Extension definition could look like this: <extension qualifier="governor-issues">
<property name="servers">
jira-community:
type: jira
server: https://issues.apache.org/jira
jira-production:
type: jira
server: https://issues.jboss.org
bugzilla:
type: bugzilla
server: http://bugzilla.redhat.com
github:
type: github
server: https://github.com/arquillian/arquillian-governor
gitlab:
type: gitlab
server: ????
</property>
</extension> (I was inspired with What do you think? |
While technically doable I am not fan of it. I think you make it just too complicated. Firstly, my "extension per server" approach is more clean then putting all stuff into one extension in some yaml and it is just better readable and maintainable. Secondly, from Java 8 on, you can use multiple annotations of the same type (not only) on a method so you could write this:
Thridly, I do not quite believe that there is a use case for having two Jiras on different servers which are dealing with one test method, however, let's pretend there is. My point of using However, keeping in mind your request - I would then implement it as you want - by adding In case you have to stick with Java 6 / 7 at work and not execute it with Java 8, multiple annotations of the same type on a test method are out of question so I would have to wrap it into Is that really want you want? |
As far as I remember, you can use multiple Governor annotations of different type on a test method right now out of the box ... |
ad Firstly) I think that it is actually only one extension with more complex configuration.
I agree that my proposal is too complex. But our team would really use all the issue sources which I mentioned (Jira, BZ, Github, Gitlab). We are willing to contribute to this project and implement this feature but firstly we have to agree on something. |
Ok. So we do it like this: we will go with my proposal of extension per server and there will be "server= " arguments in
There will be Example:
In case there is just one Jira server, it would look like this:
Theoretically like this:
I am not sure I am ok with it. I do not like the fact you have to wrap it when you have just one Jira issue. I try to support the original version as well but I am not sure how difficult that will be.
Lastly, there is not BZ integration yet and I would love to merge it. We have GitHub, Jira and Redmine covered. I do not know how GitLab is different from GitHub. I think they differ but I don't know how much. Currently, There are test execution deciders which decide if respective |
public @interface Jiras {
Jira[] list();
boolean force() default false;
}
What do you think? |
OK, I will look into it in a few days and let you know how I am doing. |
Hi, <extension qualifier="governor-jira">
<servers>
<server name="production">
<url>
<password>
...
</server>
<server name="community">
<url>
<password>
...
</server>
<servers>
</extension> If only one server is used, then it can be defined in old form (backward compatibility) or can be defined as one single server in a
|
default server name will be "default" (that will be the value in the Jira annotation) and in case I parse extension without suffix, I will register it under "default" name - so the current behaviour when you have just one server will be the same. Yes I aggree with you on not wrapping single Jira in Jiras. If you want to add |
the "default" name sounds good :-) BTW. currently - is there possibility to have one test method annotated by two annotations |
yes it should work |
Thanks. I was asking because I wasn't sure whether the |
Stefan, are you going to implement it? I can try it if you do not have time. |
i will try to do it during weekend, after that, it is your turn |
tests are not written properly, what do you think? |
@basovnik i put there another commit but I am not sure if it is good path. the thing is that I do not know what to do when you have Jiras case. You said that if you put force on the execution, if it is true, then "force" in "Jira" annotation will be skipped. But if force is true and that method will be executed (or it is not true but you have just multiple jiras in that array) if you are about to close that issue, how do you know against which jira server (wrapped Jira annotation) it was resolved? |
@smiklosovic, I am not sure if I understand you. But when you invoke a test case you catch |
@smiklosovic Hi Stefan, are you working on this issue now? If not, I would like to have new release containing last few commits. |
Sure, do the job and I will gladly merge! |
I thought that you will finish this issue. Our necessary commits with detectors support are already in release 1.0.3.Final. This issue should be in the next release. Are you going to finish this issue? You have already spent some time with this issue... |
just do it please |
@basovnik @smiklosovic What is the status of it? We can consider taking it over if there is some initial work done. |
It would be great to support several servers. It is useful when you have different jira servers for community and product. But there can be conflict in names. So
@Jira
annotation could have optional argument to define server id.The text was updated successfully, but these errors were encountered: