Skip to content

Commit

Permalink
Update dependency io.cucumber:ci-environment to v9 (#2475)
Browse files Browse the repository at this point in the history
* Update dependency io.cucumber:ci-environment to v9

* Use new ci-environment api

Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: M.P. Korstanje <[email protected]>
  • Loading branch information
3 people authored Jan 30, 2022
1 parent 6d12fde commit b9308cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added

### Changed
* Update dependency io.cucumber:ci-environment to v9 ([#2475](https://github.com/cucumber/cucumber-jvm/pull/2475) M.P. Korstanje)
* Update dependency io.cucumber:html-formatter to v18 ([#2476](https://github.com/cucumber/cucumber-jvm/pull/2476) M.P. Korstanje)
- Removed work around for 'Uncaught TypeError: e.git is undefined'

Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<name>Cucumber-JVM: Bill of Materials</name>

<properties>
<ci-environment.version>8.1.0</ci-environment.version>
<ci-environment.version>9.0.0</ci-environment.version>
<cucumber-expressions.version>15.0.1</cucumber-expressions.version>
<datatable.version>4.1.0</datatable.version>
<html-formatter.version>18.0.0</html-formatter.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.cucumber.core.runtime;

import io.cucumber.cienvironment.CiEnvironment;
import io.cucumber.core.eventbus.EventBus;
import io.cucumber.core.gherkin.Feature;
import io.cucumber.core.logging.Logger;
Expand Down Expand Up @@ -65,27 +64,17 @@ private Meta createMeta() {
new Product(System.getProperty("java.vm.name"), System.getProperty("java.vm.version")),
new Product(System.getProperty("os.name"), null),
new Product(System.getProperty("os.arch"), null),
createCi());
}

private Ci createCi() {
CiEnvironment ciEnvironment = detectCiEnvironment(System.getenv());
if (ciEnvironment == null) {
return null;
}

return new Ci(
ciEnvironment.getName(),
ciEnvironment.getUrl(),
ciEnvironment.getBuildNumber(),
createGit(ciEnvironment.getGit()));
}

private Git createGit(CiEnvironment.Git ciGit) {
if (ciGit == null) {
return null;
}
return new Git(ciGit.getRemote(), ciGit.getRevision(), ciGit.getBranch(), ciGit.getTag());
detectCiEnvironment(System.getenv()).map(ci -> new Ci(
ci.getName(),
ci.getUrl(),
ci.getBuildNumber().orElse(null),
ci.getGit().map(git -> new Git(
git.getRemote(),
git.getRevision(),
git.getBranch().orElse(null),
git.getTag().orElse(null)))
.orElse(null)))
.orElse(null));
}

private void emitTestRunStarted() {
Expand Down

0 comments on commit b9308cd

Please sign in to comment.