-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[CI] Add pipeline library unit tests #68556
Conversation
@@ -221,6 +221,8 @@ def call(Map params = [:], Closure closure) { | |||
timestamps { | |||
ansiColor('xterm') { | |||
if (config.checkPrChanges && githubPr.isPr()) { | |||
pipelineLibraryTests() |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 = [] |
There was a problem hiding this comment.
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.
Pinging @elastic/kibana-operations (Team:Operations) |
@elasticmachine merge upstream |
There was a problem hiding this 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.
https://kibana-ci.elastic.co/job/elastic+kibana+pipeline-pull-request/52560/execution/node/50/log/
Do you think we should add this to the CI proxy cache? |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
# Conflicts: # .gitignore
# Conflicts: # .gitignore
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. |
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.