Skip to content

Commit 906d5bd

Browse files
donoghucv1v
andauthored
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 <victormartinezrubio@gmail.com>
1 parent f1b8d9c commit 906d5bd

File tree

3 files changed

+147
-25
lines changed

3 files changed

+147
-25
lines changed

.buildkite/pull-requests.json

Lines changed: 65 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,66 @@
11
{
2-
"jobs": [
3-
{
4-
"enabled": true,
5-
"pipeline_slug": "logstash-pull-request-pipeline",
6-
"allow_org_users": true,
7-
"allowed_repo_permissions": ["admin", "write"],
8-
"allowed_list": ["dependabot[bot]", "mergify[bot]", "github-actions[bot]", "elastic-vault-github-plugin-prod[bot]"],
9-
"set_commit_status": true,
10-
"build_on_commit": true,
11-
"build_on_comment": true,
12-
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
13-
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
14-
"skip_ci_labels": [ ],
15-
"skip_target_branches": [ ],
16-
"skip_ci_on_only_changed": [
17-
"^.github/",
18-
"^docs/",
19-
"^.mergify.yml$",
20-
"^.pre-commit-config.yaml",
21-
"\\.md$"
22-
],
23-
"always_require_ci_on_changed": [ ]
24-
}
25-
]
26-
}
2+
"jobs": [
3+
{
4+
"enabled": true,
5+
"pipeline_slug": "logstash-pull-request-pipeline",
6+
"allow_org_users": true,
7+
"allowed_repo_permissions": [
8+
"admin",
9+
"write"
10+
],
11+
"allowed_list": [
12+
"dependabot[bot]",
13+
"mergify[bot]",
14+
"github-actions[bot]",
15+
"elastic-vault-github-plugin-prod[bot]"
16+
],
17+
"set_commit_status": true,
18+
"build_on_commit": true,
19+
"build_on_comment": true,
20+
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
21+
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
22+
"skip_ci_labels": [],
23+
"skip_target_branches": [],
24+
"skip_ci_on_only_changed": [
25+
"^.github/",
26+
"^docs/",
27+
"^.mergify.yml$",
28+
"^.pre-commit-config.yaml",
29+
"\\.md$"
30+
],
31+
"always_require_ci_on_changed": []
32+
},
33+
{
34+
"enabled": true,
35+
"pipeline_slug": "logstash-smart-exhaustive-tests-pipeline",
36+
"allow_org_users": true,
37+
"allowed_repo_permissions": [
38+
"admin",
39+
"write"
40+
],
41+
"allowed_list": [
42+
"dependabot[bot]",
43+
"mergify[bot]",
44+
"github-actions[bot]"
45+
],
46+
"set_commit_status": true,
47+
"build_on_commit": true,
48+
"build_on_comment": true,
49+
"trigger_comment_regex": "^run\\s+exhaustive\\s+tests$",
50+
"always_trigger_comment_regex": "^run\\s+exhaustive\\s+tests$",
51+
"skip_ci_labels": [],
52+
"skip_target_branches": [],
53+
"skip_ci_on_only_changed": [
54+
"^.github/",
55+
"^docs/",
56+
"^.mergify.yml$",
57+
"^.pre-commit-config.yaml",
58+
"\\.md$"
59+
],
60+
"always_require_ci_on_changed": [
61+
"^qa/acceptance/",
62+
"^ci/acceptance_tests.sh"
63+
]
64+
}
65+
]
66+
}
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
@@ -478,6 +478,57 @@ spec:
478478
# SECTION END: Exhaustive tests pipeline
479479
# **************************************
480480

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

0 commit comments

Comments
 (0)