Skip to content

Commit f5c4930

Browse files
donoghucmergify[bot]
authored andcommitted
Backport smart exhaustive tests (#18386)
* feat(ci): support exhaustive tests for PRs (code changes or GH comment) (#18327) * bk: fix regex and add new file (#18382) * bk(smart exhaustive tests): tune the steps to support GH comments and changesets (#18383) * chore: remove test file for exhaustive tests and normalise github commands (#18384) --------- Co-authored-by: Victor Martinez <[email protected]> (cherry picked from commit 906d5bd) # Conflicts: # .buildkite/pull-requests.json
1 parent a4740ed commit f5c4930

File tree

3 files changed

+150
-0
lines changed

3 files changed

+150
-0
lines changed

.buildkite/pull-requests.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
<<<<<<< HEAD
23
"jobs": [
34
{
45
"enabled": true,
@@ -20,3 +21,70 @@
2021
}
2122
]
2223
}
24+
=======
25+
"jobs": [
26+
{
27+
"enabled": true,
28+
"pipeline_slug": "logstash-pull-request-pipeline",
29+
"allow_org_users": true,
30+
"allowed_repo_permissions": [
31+
"admin",
32+
"write"
33+
],
34+
"allowed_list": [
35+
"dependabot[bot]",
36+
"mergify[bot]",
37+
"github-actions[bot]",
38+
"elastic-vault-github-plugin-prod[bot]"
39+
],
40+
"set_commit_status": true,
41+
"build_on_commit": true,
42+
"build_on_comment": true,
43+
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
44+
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
45+
"skip_ci_labels": [],
46+
"skip_target_branches": [],
47+
"skip_ci_on_only_changed": [
48+
"^.github/",
49+
"^docs/",
50+
"^.mergify.yml$",
51+
"^.pre-commit-config.yaml",
52+
"\\.md$"
53+
],
54+
"always_require_ci_on_changed": []
55+
},
56+
{
57+
"enabled": true,
58+
"pipeline_slug": "logstash-smart-exhaustive-tests-pipeline",
59+
"allow_org_users": true,
60+
"allowed_repo_permissions": [
61+
"admin",
62+
"write"
63+
],
64+
"allowed_list": [
65+
"dependabot[bot]",
66+
"mergify[bot]",
67+
"github-actions[bot]"
68+
],
69+
"set_commit_status": true,
70+
"build_on_commit": true,
71+
"build_on_comment": true,
72+
"trigger_comment_regex": "^run\\s+exhaustive\\s+tests$",
73+
"always_trigger_comment_regex": "^run\\s+exhaustive\\s+tests$",
74+
"skip_ci_labels": [],
75+
"skip_target_branches": [],
76+
"skip_ci_on_only_changed": [
77+
"^.github/",
78+
"^docs/",
79+
"^.mergify.yml$",
80+
"^.pre-commit-config.yaml",
81+
"\\.md$"
82+
],
83+
"always_require_ci_on_changed": [
84+
"^qa/acceptance/",
85+
"^ci/acceptance_tests.sh"
86+
]
87+
}
88+
]
89+
}
90+
>>>>>>> 906d5bd6 (Backport smart exhaustive tests (#18386))
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
steps:
2+
- label: "Trigger logstash-exhaustive-tests-pipeline for PRs with qa/acceptance/ changes"
3+
if: build.pull_request.id != null && build.env("GITHUB_PR_TRIGGER_COMMENT") != "run exhaustive tests"
4+
plugins:
5+
- monorepo-diff#v1.0.1:
6+
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
7+
interpolation: false
8+
watch:
9+
- path:
10+
- ^qa/acceptance/
11+
- ^ci/acceptance_tests.sh
12+
- .buildkite/smart_exhaustive_tests_pipeline.yml
13+
config:
14+
trigger: "logstash-exhaustive-tests-pipeline"
15+
build:
16+
commit: "${BUILDKITE_COMMIT}"
17+
branch: "${BUILDKITE_BRANCH}"
18+
env:
19+
BUILDKITE_PULL_REQUEST: "${BUILDKITE_PULL_REQUEST}"
20+
BUILDKITE_PULL_REQUEST_BASE_BRANCH: "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}"
21+
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: false
22+
23+
- label: "Trigger logstash-exhaustive-tests-pipeline for GitHub comments"
24+
if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "run exhaustive tests"
25+
trigger: "logstash-exhaustive-tests-pipeline"
26+
build:
27+
commit: "HEAD"
28+
branch: "pull/${BUILDKITE_PULL_REQUEST}/merge"
29+
env:
30+
BUILDKITE_PULL_REQUEST: "${BUILDKITE_PULL_REQUEST}"
31+
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: false

catalog-info.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,57 @@ spec:
476476
# SECTION END: Exhaustive tests pipeline
477477
# **************************************
478478

479+
# ****************************************
480+
# SECTION START: Smart exhaustive tests pipeline
481+
# ****************************************
482+
483+
---
484+
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
485+
apiVersion: backstage.io/v1alpha1
486+
kind: Resource
487+
metadata:
488+
name: logstash-smart-exhaustive-tests-pipeline
489+
description: 'Logstash Smart Exhaustive tests pipeline'
490+
links:
491+
- title: 'Logstash Smart Exhaustive tests pipeline'
492+
url: https://buildkite.com/elastic/logstash-smart-exhaustive-tests-pipeline
493+
spec:
494+
type: buildkite-pipeline
495+
owner: group:logstash
496+
system: platform-ingest
497+
implementation:
498+
apiVersion: buildkite.elastic.dev/v1
499+
kind: Pipeline
500+
metadata:
501+
name: "Logstash Smart Exhaustive tests pipeline"
502+
description: '🔍 Run smart exhaustive tests against Logstash using different operating systems'
503+
spec:
504+
repository: elastic/logstash
505+
pipeline_file: ".buildkite/smart_exhaustive_tests_pipeline.yml"
506+
provider_settings:
507+
build_pull_request_forks: false
508+
build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot
509+
build_branches: false
510+
build_tags: false
511+
filter_enabled: true
512+
filter_condition: >-
513+
build.creator.name == 'elasticmachine' && build.pull_request.id != null
514+
cancel_intermediate_builds: true
515+
skip_intermediate_builds: true
516+
teams:
517+
ingest-fp:
518+
access_level: MANAGE_BUILD_AND_READ
519+
logstash:
520+
access_level: MANAGE_BUILD_AND_READ
521+
ingest-eng-prod:
522+
access_level: MANAGE_BUILD_AND_READ
523+
everyone:
524+
access_level: READ_ONLY
525+
526+
# **************************************
527+
# SECTION END: Smart exhaustive tests pipeline
528+
# **************************************
529+
479530
# ********************************************
480531
# Declare supported plugin tests pipeline
481532
# ********************************************

0 commit comments

Comments
 (0)