Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Flaky test comments #754

Merged
merged 22 commits into from
Oct 14, 2020
Merged

Flaky test comments #754

merged 22 commits into from
Oct 14, 2020

Conversation

v1v
Copy link
Member

@v1v v1v commented Oct 6, 2020

What does this PR do?

Support flaky test reporting, for such it's required to:

  • lookForGitHubIssues to query the open GitHub issues that got a match with the given test-failures.
  • githubCreateIssue to return the issue that has been created.
  • enable errorDetails for the test errors.
  • Create templates for creating GH issues
  • Create template for the GH comment for flakey tests.
  • gh wrapper.
  • githubIssues to query all the open GitHub issues with the gh wrapper.

Important

  • This particular process will create GitHub issues if no match with the labels flaky-test,ci-reported.
  • The look up will filter all the issues that are not open and don't have the labels flaky-test,ci-reported.
  • The test-failure name match with the GitHub issues are based on the title with the filter contains.
  • gh has been configured to retrieve up to 200 GH issues.

Why is it important?

Provide more information when tests are failing and whether they were reported as flakey too.

Related issues

Relates to #753

Tasks

  • UTs for vars/githubCreateIssue.groovy
  • lookForGitHubIssues
  • Resilience if issue creation fails, to retry once more

Screenshots

When there are matching flakey tests:

image

When there is an issue creation regarding the flakey test:

image

Tests

ITs for gh

image

@v1v v1v self-assigned this Oct 6, 2020
@v1v v1v added the automation label Oct 6, 2020
@apmmachine
Copy link
Contributor

apmmachine commented Oct 6, 2020

💚 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

Expand to view the summary

Build stats

  • Build Cause: [Pull request #754 updated]

  • Start Time: 2020-10-13T14:09:39.616+0000

  • Duration: 8 min 25 sec

Test stats 🧪

Test Results
Failed 0
Passed 834
Skipped 18
Total 852

@@ -0,0 +1,17 @@
## :bug: Flaky test report
Copy link
Member Author

Choose a reason for hiding this comment

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

An example of the output from the UTs:

image

@@ -0,0 +1,17 @@
## Flaky Test
Copy link
Member Author

Choose a reason for hiding this comment

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

An example of the UTs output

image

@v1v v1v added the enhancement New feature or request label Oct 6, 2020
@v1v
Copy link
Member Author

v1v commented Oct 6, 2020

jenkins run the tests please

v1v added 4 commits October 12, 2020 16:10
…orting

* upstream/master:
  docs: update CHANGELOG.md
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release v1.1.148
  Fix formatting in flake report (#763)
  slack message for no push events (#762)
  ci: add workers to the infra test (#759)
  Update github-comment-markdown.template (#758)
  [DOCS] Add badge details (#757)
@v1v v1v marked this pull request as ready for review October 12, 2020 16:27
@v1v v1v requested a review from a team October 12, 2020 16:27
Comment on lines +37 to +40
def value = sh(label: 'Create GitHub issue', script: "hub issue create ${title} ${description} ${assign} ${labels} ${milestone}", returnStdout: returnStdout).trim()
if(returnStdout) {
return value
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Probably we don't need this but always returning the stdout

@v1v
Copy link
Member Author

v1v commented Oct 12, 2020

There is a dependency regarding the gh in the jenkins instance, since the notifyBuildResult runs in node('master || metal || immutable'){, waiting for the infra team to confirm if we can do that. So far, there is a PR to support gh in the workers, but it might not be enough for our use case.

The reason for using gh was to avoid the pagination when using the github api

Copy link
Contributor

@cachedout cachedout left a comment

Choose a reason for hiding this comment

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

💯 Nice work!

resources/flakey-github-issue.template Outdated Show resolved Hide resolved
resources/scripts/generate-build-data.sh Outdated Show resolved Hide resolved
githubPrComment(message: msg, commentFile: 'flakey.id')

def labels = 'flaky-test,ci-reported'
def tests = lookForGitHubIssues(flakeyList: ret, labelsFilter: labels.split(','))
Copy link
Contributor

Choose a reason for hiding this comment

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

We are mixing two spellings here. We have flakey and flaky. I think we should standarize on flaky wherever possible.

def issue = v
if (!v?.trim()) {
def issueDescription = buildTemplate([
"template": 'flakey-github-issue.template',
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment above flaky versus flakey

v1v and others added 5 commits October 13, 2020 12:59
…orting

* upstream/master:
  Return PR URL with githubCreatePullRequest step (#765)
Co-authored-by: cachedout <mike.place@elastic.co>
…-library into feature/flaky-reporting

* 'feature/flaky-reporting' of github.com:v1v/apm-pipeline-library:
  Apply suggestions from code review
@v1v v1v changed the title Flakey test comments Flaky test comments Oct 13, 2020
@v1v
Copy link
Member Author

v1v commented Oct 13, 2020

I just updated all the new references from flakey to flaky :)

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

Successfully merging this pull request may close these issues.

4 participants