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

Set setNotFailingStatuses for jenkins in CucumberReportPublisher #376

Open
AyushRawat1 opened this issue Sep 11, 2020 · 15 comments
Open

Set setNotFailingStatuses for jenkins in CucumberReportPublisher #376

AyushRawat1 opened this issue Sep 11, 2020 · 15 comments

Comments

@AyushRawat1
Copy link

Hi @damianszczepanik,
In an issue (#364), The issue was fixed but it can only be fixed programmatically is there any way we can set the non failing statuses in jenkins if not can this be fixed from your end?

Like we do for other features
mergeFeaturesWithRetest: true,
sortingMethod: 'ALPHABETICAL',

can it be done for the notfailingstatuses like below??
notFailingStatuses: 'SKIPPED'

@damianszczepanik
Copy link
Member

I don't think this was promoted from https://github.com/damianszczepanik/cucumber-reporting project
Would you like to add support for this?

@AyushRawat1
Copy link
Author

Hi @damianszczepanik,
yesy this issue is promoted in cucumber-reports-plugin and my point being (CucumberReportPublisher.java https://github.com/jenkinsci/cucumber-reports-plugin/blob/master/src/main/java/net/masterthought/jenkins/CucumberReportPublisher.java) is the class responsible for exposing features to jenkins right??

can we add the set not failing statuses to this class so that we can set this feature from jenkins like for other features we do mergeFeaturesWithRetest: true,
sortingMethod: 'ALPHABETICAL' in the jenkins

can the same be added to the CucumberReportPublisher so that i can set the not failing statuses from jenkins??

@damianszczepanik
Copy link
Member

That's correct

@AyushRawat1
Copy link
Author

AyushRawat1 commented Sep 17, 2020

@damianszczepanik thanks for the update, So can i hope for the fix?

@AyushRawat1
Copy link
Author

@damianszczepanik any updates on this fix??

@damianszczepanik
Copy link
Member

Sorry, I though you will be the one who promote support for this :)

@AyushRawat1
Copy link
Author

@damianszczepanik ok let me look into it and i will support the fix

@AyushRawat1
Copy link
Author

AyushRawat1 commented Sep 28, 2020

@damianszczepanik i currently don't have access to create PR for the issue but i have updated the feature in CucumberReportPublisher.java and i am attaching the class you can check if that's ok

The additions are on
1: line 79 private Set notFailingStatues;

2: line 179 if (notFailingStatues == null) {
notFailingStatues = Collections.emptySet();
}

3: line 132 public Set getNotFailingStatues() { return notFailingStatues; }

@DataBoundSetter
public void setNotFailingStatues(Set<Status> notFailingStatues) {
  // don't store the status if there was no element provided
  if (CollectionUtils.isNotEmpty(notFailingStatues)) {
    this.notFailingStatues = notFailingStatues;
  }
}

and
4: line 459 configuration.setNotFailingStatuses(notFailingStatues);

CucumberReportPublisher.zip

@AyushRawat1
Copy link
Author

AyushRawat1 commented Sep 28, 2020

@damianszczepanik and this is how i am thinking of using it through jekins, you can tell me if that's ok

def s = ["SKIPPED"] as Set
always {
cucumber fileIncludePattern: "${env.BUILD_NUMBER}/build/cucumber/bbt_*.json",
reportTitle: "${params.title}${env.TEST_ENVIRONMENT}/${params.cucumber_tag}",
notFailingStatues: s
}

@AyushRawat1
Copy link
Author

@damianszczepanik any review on the fix i did for the CucumberReportPublisher.java?

@damianszczepanik
Copy link
Member

I won't do it without PR which can be created after forking the repo

@AyushRawat1
Copy link
Author

@damianszczepanik thanks will do that

@AyushRawat1
Copy link
Author

Hi @damianszczepanik

this is the PR for this issue that i have raised you can review it now

caaa45b

@AyushRawat1
Copy link
Author

@damianszczepanik can you please review the PR and tell me if anything is to be modified or changed??
Thanks

@madalinaptj
Copy link

Any updates on this? Looking for the same functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants