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

[CI] Add pipeline library unit tests #68556

Merged
merged 18 commits into from
Jun 11, 2020

Conversation

brianseeders
Copy link
Contributor

@brianseeders brianseeders commented Jun 8, 2020

I'm not satisfied with this setup, but it's already helped me catch a few things, so I'd like to get it out there. I'm still figuring things out as I write more tests and I expect it to evolve a lot. Jenkins, Pipelines, and the Shared Library system don't make things particularly straightforward.

Currently, the tests run only in PRs that change pipeline-related code. It doesn't run as part of non-PR CI.

Two small Slack message bugs are also fixed as part of this.

The gradle wrapper stuff is auto-generated (it's supposed to be committed), so you can ignore it.

@brianseeders brianseeders added Feature:CI Continuous integration release_note:skip Skip the PR/issue when compiling release notes v8.0.0 v7.9.0 v7.8.1 v7.7.1 v6.8.10 labels Jun 8, 2020
@@ -221,6 +221,8 @@ def call(Map params = [:], Closure closure) {
timestamps {
ansiColor('xterm') {
if (config.checkPrChanges && githubPr.isPr()) {
pipelineLibraryTests()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a temporary location for this just until #64011 is finished

@@ -235,5 +237,15 @@ def call(Map params = [:], Closure closure) {
}
}

def pipelineLibraryTests() {
whenChanged(['vars/', '.ci/pipeline-library/']) {
workers.base(size: 'flyweight', bootstrapped: false, ramDisk: false) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once #64011 is merged, this will just be a task rather than a separate agent.

@@ -1,13 +1,14 @@
import groovy.transform.Field

public static @Field PR_CHANGES_CACHE = null
public static @Field PR_CHANGES_CACHE = []
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a change that's here only to accommodate the unit test framework. There was a really hard to figure out scope problem related to how the testing framework works.

@brianseeders brianseeders added the Team:Operations Team label for Operations Team label Jun 8, 2020
@brianseeders brianseeders requested a review from a team June 8, 2020 21:30
@brianseeders brianseeders marked this pull request as ready for review June 8, 2020 21:30
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@brianseeders
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

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

I'd love to get a walkthrough of how the tests actually work (what is props() actually doing?) but LGTM especially since you're getting value out of them and they only run when changing pipeline related code.

@spalger
Copy link
Contributor

spalger commented Jun 8, 2020

https://kibana-ci.elastic.co/job/elastic+kibana+pipeline-pull-request/52560/execution/node/50/log/

14:22:06 Exception in thread "main" java.io.IOException: Downloading from https://services.gradle.org/distributions/gradle-6.4.1-bin.zip failed: timeout
14:22:06 at org.gradle.wrapper.Download.downloadInternal(Download.java:106)
14:22:06 at org.gradle.wrapper.Download.download(Download.java:66)

Do you think we should add this to the CI proxy cache?

@brianseeders
Copy link
Contributor Author

@elasticmachine merge upstream

@brianseeders
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@brianseeders brianseeders merged commit 9c98ba9 into elastic:master Jun 11, 2020
@brianseeders brianseeders deleted the pipeline-library-testing branch June 11, 2020 16:19
brianseeders added a commit to brianseeders/kibana that referenced this pull request Jun 11, 2020
brianseeders added a commit to brianseeders/kibana that referenced this pull request Jun 11, 2020
brianseeders added a commit to brianseeders/kibana that referenced this pull request Jun 11, 2020
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 15, 2020
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:CI Continuous integration release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.7.2 v7.8.1 v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants