Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

chore: bump Godog to v0.12.4#2245

Merged
mdelapenya merged 27 commits intoelastic:mainfrom
mdelapenya:godog-bump
Mar 21, 2022
Merged

chore: bump Godog to v0.12.4#2245
mdelapenya merged 27 commits intoelastic:mainfrom
mdelapenya:godog-bump

Conversation

@mdelapenya
Copy link
Copy Markdown
Contributor

@mdelapenya mdelapenya commented Mar 17, 2022

  • chore: bump godog to v.0.12.4
  • chore: update BeforeScenario/AfterScenario to Before/After
  • chore: update BeforeStep/AfterStep to StepContext().Before/After
  • chore: log before/after steps
  • chore: consistent variable name
  • chore: log step status after execution
  • chore: support multiple formatters
  • chore: store cucumber reports in Jenkins UI

What does this PR do?

It bumps Godog from 0.11 to 0.12.4, which includes multi-formatter support.

For that, we have updated the Go dependencies, and had to update the usages of the lifecycle hooks defined by Godog: BeforeScenario/BeforeStep and AfterScenario/AfterStep are now deprecated.

Finally, we updated the scripts that generate the test report to include 3 formatters: pretty, cucumber and JUnit.

The cucumber format will be stored as a JSON file, downloaded by the Jenkins pipeline, and archived in the Jenkins UI using a script that consumes the Docker image described in #120, generating the HTML report.

Why is it important?

Let's keep dependencies up-to-date, getting the new features it provides, in this case, the multi-formatter support, which will allow us to share nicer reports about the cucumber scenarios.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have run the Unit tests (make unit-test), and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
  • I have noticed new Go dependencies (run make notice in the proper directory)

Related issues

Follow-ups

It could be interesting to consolidate all cucumber JSON reports into one, and generate just one HTML report.

@mdelapenya mdelapenya added Team:Automation Label for the Observability productivity team backport-v7.17.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify backport-v8.1.0 Automated backport with mergify dependency labels Mar 17, 2022
@mdelapenya mdelapenya self-assigned this Mar 17, 2022
@mdelapenya mdelapenya requested review from a team and adam-stokes March 17, 2022 12:46
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Mar 17, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-03-21T12:13:07.439+0000

  • Duration: 52 min 41 sec

Test stats 🧪

Test Results
Failed 0
Passed 276
Skipped 0
Total 276

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

set -euxo pipefail

## original image: ystia/cucumber-html-reporter:latest
readonly DOCKER_IMAGE="docker.elastic.co/observability-ci/cucumber-html-reporter:latest"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already pushed the image under our registry, just in case the image disappears

do
filename="$(basename ${f})"
echo "parsing ${filename}"
docker run --rm \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +21 to +24
for f in ${FILES}
do
filename="$(basename ${f})"
echo "parsing ${filename}"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, the glob expression is not expanded on CI. I'm able to execute this:

$ CUCUMBER_REPORTS_PATH=e2e/_suites/fleet SUITE=fleet ARCHITECTURE=amd TAGS=standalone PLATFORM=Darwin .ci/scripts/generate-cucumber-reports.sh 
+ readonly DOCKER_IMAGE=docker.elastic.co/observability-ci/cucumber-html-reporter:latest
+ DOCKER_IMAGE=docker.elastic.co/observability-ci/cucumber-html-reporter:latest
+ CUCUMBER_REPORTS_PATH=e2e/_suites/fleet
+ FILES='e2e/_suites/fleet/TEST*.json'
+ ARCHITECTURE=amd
+ PLATFORM=Darwin
+ SUITE=fleet
+ TAGS=standalone
+ main
+ for f in ${FILES}
++ basename e2e/_suites/fleet/TEST.json
+ filename=TEST.json
+ echo 'parsing TEST.json'
parsing TEST.json
++ pwd
++ pwd
+ docker run --rm -v /Users/mdelapenya/sourcecode/src/github.com/elastic/e2e-testing/e2e/_suites/fleet:/use/src/app/in -v /Users/mdelapenya/sourcecode/src/github.com/elastic/e2e-testing/outputs:/use/src/app/out -e CHR_APP_jsonFile=in/TEST.json -e CHR_APP_output=out/TEST.json.html -e CHR_APP_metadata_arch=amd -e CHR_APP_metadata_platform=Darwin -e CHR_APP_metadata_suite=fleet -e CHR_APP_metadata_tags=standalone docker.elastic.co/observability-ci/cucumber-html-reporter:latest

> cucumber-html-reporter@0.0.1 start /use/src/app
> node main.js

Cucumber HTML report out/TEST.json.html generated successfully.
+ for f in ${FILES}
++ basename e2e/_suites/fleet/TEST2.json
+ filename=TEST2.json
+ echo 'parsing TEST2.json'
parsing TEST2.json
++ pwd
++ pwd
+ docker run --rm -v /Users/mdelapenya/sourcecode/src/github.com/elastic/e2e-testing/e2e/_suites/fleet:/use/src/app/in -v /Users/mdelapenya/sourcecode/src/github.com/elastic/e2e-testing/outputs:/use/src/app/out -e CHR_APP_jsonFile=in/TEST2.json -e CHR_APP_output=out/TEST2.json.html -e CHR_APP_metadata_arch=amd -e CHR_APP_metadata_platform=Darwin -e CHR_APP_metadata_suite=fleet -e CHR_APP_metadata_tags=standalone docker.elastic.co/observability-ci/cucumber-html-reporter:latest

> cucumber-html-reporter@0.0.1 start /use/src/app
> node main.js

Cucumber HTML report out/TEST2.json.html generated successfully.

where there are a few TEST*.json files under the CUCUMBER_REPORTS_PATH.

But on CI, I always get:

[2022-03-18T09:34:29.582Z] + for f in ${FILES}
[2022-03-18T09:34:29.582Z] ++ basename 'src/github.com/elastic/e2e-testing/outputs/18.224.246.92/TEST*.json'
[2022-03-18T09:34:29.582Z] + filename='TEST*.json'
[2022-03-18T09:34:29.582Z] + echo 'parsing TEST*.json'
[2022-03-18T09:34:29.582Z] parsing TEST*.json

Resulting in this error:

[2022-03-18T09:34:36.076Z] Unable to parse cucumberjs output into json: 'in/TEST*.json' { Error: in/TEST*.json: ENOENT: no such file or directory, open 'in/TEST*.json'

@v1v @kuisathaverat any guess?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if double quotes are needed in this case

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
TAGS="${TAGS:-""}"

main() {
for f in "${CUCUMBER_REPORTS_PATH}/TEST*.json"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
@adam-stokes
Copy link
Copy Markdown
Contributor

find: 'src/github.com/elastic/e2e-testing/outputs/3.14.11.190'. I think the path here is wrong, it should be WORKSPACE/outputs/.../..

@mdelapenya mdelapenya merged commit fb6385e into elastic:main Mar 21, 2022
mergify bot pushed a commit that referenced this pull request Mar 21, 2022
* chore: bump godog to v.0.12.4

* chore: update BeforeScenario/AfterScenario to Before/After

* chore: update BeforeStep/AfterStep to StepContext().Before/After

* chore: log before/after steps

* chore: consistent variable name

* chore: log step status after execution

* chore: support multiple formatters

* chore: store cucumber reports in Jenkins UI

* chore: add go-license-detector as dependency

* chore: notice

* chore: store JSON reports as an artifact

* fix: remove cucumber until the plugin is installed in the Jenkins instance

* chore: update scenario template

* fix: wrong log.Debugf signature

* chore: generate cucumber reports without the plugin

See #120

* chore: enrich cucumber reports metadata

* fix: dockerLogin before pulling the new image

* chore: update packer-cache images

* fix: run under the right dir

* fix: right path for cucumber-gen script

* chore: simplify files variable

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: apply suggestions from code review

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: remove BASE_DIR

* chore: update templates to godog v0.12.4

* fix: update stack version in template

* chore: update ES template

* fix: use output dir from the nodeIP

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
(cherry picked from commit fb6385e)
mergify bot pushed a commit that referenced this pull request Mar 21, 2022
* chore: bump godog to v.0.12.4

* chore: update BeforeScenario/AfterScenario to Before/After

* chore: update BeforeStep/AfterStep to StepContext().Before/After

* chore: log before/after steps

* chore: consistent variable name

* chore: log step status after execution

* chore: support multiple formatters

* chore: store cucumber reports in Jenkins UI

* chore: add go-license-detector as dependency

* chore: notice

* chore: store JSON reports as an artifact

* fix: remove cucumber until the plugin is installed in the Jenkins instance

* chore: update scenario template

* fix: wrong log.Debugf signature

* chore: generate cucumber reports without the plugin

See #120

* chore: enrich cucumber reports metadata

* fix: dockerLogin before pulling the new image

* chore: update packer-cache images

* fix: run under the right dir

* fix: right path for cucumber-gen script

* chore: simplify files variable

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: apply suggestions from code review

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: remove BASE_DIR

* chore: update templates to godog v0.12.4

* fix: update stack version in template

* chore: update ES template

* fix: use output dir from the nodeIP

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
(cherry picked from commit fb6385e)
mergify bot pushed a commit that referenced this pull request Mar 21, 2022
* chore: bump godog to v.0.12.4

* chore: update BeforeScenario/AfterScenario to Before/After

* chore: update BeforeStep/AfterStep to StepContext().Before/After

* chore: log before/after steps

* chore: consistent variable name

* chore: log step status after execution

* chore: support multiple formatters

* chore: store cucumber reports in Jenkins UI

* chore: add go-license-detector as dependency

* chore: notice

* chore: store JSON reports as an artifact

* fix: remove cucumber until the plugin is installed in the Jenkins instance

* chore: update scenario template

* fix: wrong log.Debugf signature

* chore: generate cucumber reports without the plugin

See #120

* chore: enrich cucumber reports metadata

* fix: dockerLogin before pulling the new image

* chore: update packer-cache images

* fix: run under the right dir

* fix: right path for cucumber-gen script

* chore: simplify files variable

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: apply suggestions from code review

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: remove BASE_DIR

* chore: update templates to godog v0.12.4

* fix: update stack version in template

* chore: update ES template

* fix: use output dir from the nodeIP

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
(cherry picked from commit fb6385e)

# Conflicts:
#	.ci/packer_cache.sh
mdelapenya added a commit that referenced this pull request Mar 21, 2022
* chore: bump godog to v.0.12.4

* chore: update BeforeScenario/AfterScenario to Before/After

* chore: update BeforeStep/AfterStep to StepContext().Before/After

* chore: log before/after steps

* chore: consistent variable name

* chore: log step status after execution

* chore: support multiple formatters

* chore: store cucumber reports in Jenkins UI

* chore: add go-license-detector as dependency

* chore: notice

* chore: store JSON reports as an artifact

* fix: remove cucumber until the plugin is installed in the Jenkins instance

* chore: update scenario template

* fix: wrong log.Debugf signature

* chore: generate cucumber reports without the plugin

See #120

* chore: enrich cucumber reports metadata

* fix: dockerLogin before pulling the new image

* chore: update packer-cache images

* fix: run under the right dir

* fix: right path for cucumber-gen script

* chore: simplify files variable

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: apply suggestions from code review

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: remove BASE_DIR

* chore: update templates to godog v0.12.4

* fix: update stack version in template

* chore: update ES template

* fix: use output dir from the nodeIP

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
(cherry picked from commit fb6385e)

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit that referenced this pull request Mar 21, 2022
* chore: bump godog to v.0.12.4

* chore: update BeforeScenario/AfterScenario to Before/After

* chore: update BeforeStep/AfterStep to StepContext().Before/After

* chore: log before/after steps

* chore: consistent variable name

* chore: log step status after execution

* chore: support multiple formatters

* chore: store cucumber reports in Jenkins UI

* chore: add go-license-detector as dependency

* chore: notice

* chore: store JSON reports as an artifact

* fix: remove cucumber until the plugin is installed in the Jenkins instance

* chore: update scenario template

* fix: wrong log.Debugf signature

* chore: generate cucumber reports without the plugin

See #120

* chore: enrich cucumber reports metadata

* fix: dockerLogin before pulling the new image

* chore: update packer-cache images

* fix: run under the right dir

* fix: right path for cucumber-gen script

* chore: simplify files variable

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: apply suggestions from code review

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: remove BASE_DIR

* chore: update templates to godog v0.12.4

* fix: update stack version in template

* chore: update ES template

* fix: use output dir from the nodeIP

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
(cherry picked from commit fb6385e)

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit that referenced this pull request Mar 21, 2022
* chore: bump Godog to v0.12.4 (#2245)

* chore: bump godog to v.0.12.4

* chore: update BeforeScenario/AfterScenario to Before/After

* chore: update BeforeStep/AfterStep to StepContext().Before/After

* chore: log before/after steps

* chore: consistent variable name

* chore: log step status after execution

* chore: support multiple formatters

* chore: store cucumber reports in Jenkins UI

* chore: add go-license-detector as dependency

* chore: notice

* chore: store JSON reports as an artifact

* fix: remove cucumber until the plugin is installed in the Jenkins instance

* chore: update scenario template

* fix: wrong log.Debugf signature

* chore: generate cucumber reports without the plugin

See #120

* chore: enrich cucumber reports metadata

* fix: dockerLogin before pulling the new image

* chore: update packer-cache images

* fix: run under the right dir

* fix: right path for cucumber-gen script

* chore: simplify files variable

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: apply suggestions from code review

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* chore: remove BASE_DIR

* chore: update templates to godog v0.12.4

* fix: update stack version in template

* chore: update ES template

* fix: use output dir from the nodeIP

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
(cherry picked from commit fb6385e)

# Conflicts:
#	.ci/packer_cache.sh

* chore: fix conflicts

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Mar 30, 2022
* main: (72 commits)
  fix: always quote variables in shell scripts (elastic#2284)
  chore: bring back system integration scenarios (elastic#2233)
  chore: do not notify build green for fleet nightly builds (elastic#2277)
  chore: include suite, platform and tags in test reports name (elastic#2273)
  bump stack version 8.2.0-dcff22d7 (elastic#2270)
  bump stack version 8.2.0-4509f321 (elastic#2265)
  chore: bump Godog to v0.12.4 (elastic#2245)
  bump stack version 8.2.0-5cc993c1 (elastic#2254)
  bump stack version 8.2.0-82b803a1 (elastic#2250)
  fix: never process elasticsearch CI artifacts (elastic#2246)
  bump stack version 8.2.0-ff67d7b8 (elastic#2242)
  ci: periodic builds for the last two minor versions (elastic#2241)
  bump stack version 8.2.0-9bac538c (elastic#2240)
  fix: add end-of-file line in templates (elastic#2237)
  chore: add Christos to SSH users
  bump stack version 8.2.0-fee3b8d2 (elastic#2234)
  Separate ES workload from Agent spec and make it req for the scenarios (elastic#2203)
  bump stack version 8.2.0-d02c907a (elastic#2228)
  bump stack version 8.2.0-63265ec9 (elastic#2225)
  fix: wrong link (elastic#2220)
  ...
@mdelapenya mdelapenya deleted the godog-bump branch July 13, 2022 09:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport-v7.17.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify backport-v8.1.0 Automated backport with mergify dependency Team:Automation Label for the Observability productivity team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump godog to v0.12.0 Provide HTML reports

5 participants