Skip to content

Commit

Permalink
CI: modify it
Browse files Browse the repository at this point in the history
  • Loading branch information
maxknv committed Mar 22, 2024
1 parent 12e35ad commit 7d7025a
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 33 deletions.
53 changes: 26 additions & 27 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,29 @@ At a minimum, the following information should be added (but add more as needed)
---
### Modify your CI run:
##### NOTE:
- if your merge the PR with modified CI you **MUST** know what you are doing.
- modifiers can be applied only if set before CI starts
- remove `!` to apply
- return all `!` to restore defaults
```
!#ci_set_<SET_NAME> - to run only preconfigured set of tests, e.g.:
!#ci_set_arm - to run only integration tests on ARM
!#ci_set_integration - to run only integration tests on AMD
!#ci_set_analyzer - to run only tests for analyzer
NOTE: you can configure your own ci set
```
```
!#job_<JOB NAME> - to run only specified job, e.g.:
!#job_stateless_tests_release
!#job_package_debug
!#job_style_check
!#job_integration_tests_asan
```
```
!#batch_2 - to run only 2nd batch for all multi-batch jobs
!#btach_1_2_3 - to run only 1, 2, 3rd batch for all multi-batch jobs
```
```
!#no_merge_commit - to disable merge commit (no merge from master)
!#do_not_test - to disable whole CI (except style check)
```
**NOTE:** If your merge the PR with modified CI you **MUST KNOW** what you are doing
**NOTE:** Set desired options before CI starts or re-push after updates

#### Run only:
- [ ] <!---ci_set_integration--> Integration tests
- [ ] <!---ci_set_arm--> Integration tests (arm64)
- [ ] <!---ci_set_stateless--> Stateless tests (release)
- [ ] <!---ci_set_stateless_asan--> Stateless tests (asan)
- [ ] <!---ci_set_stateful--> Stateful tests (release)
- [ ] <!---ci_set_stateful_asan--> Stateful tests (asan)
- [ ] <!---ci_set_reduced--> No sanitizers
- [ ] <!---ci_set_analyzer--> Tests with analyzer
- [ ] <!---ci_set_fast--> Fast tests
- [ ] <!---job_package_debug--> Only package_debug build
- [ ] <!---PLACE_YOUR_TAG_CONFIGURED_IN_ci_config.py_FILE_HERE--> Add your CI variant description here

#### CI options:
- [ ] <!---do_not_test--> do not test (only style check)
- [ ] <!---no_merge_commit--> disable merge-commit (no merge from master before tests)
- [ ] <!---no_ci_cache--> disable CI cache (job reuse)

#### Only specified batches in multi-batch jobs:
- [ ] <!---batch_0--> 1
- [ ] <!---batch_1--> 2
- [ ] <!---batch_2--> 3
- [ ] <!---batch_3--> 4
9 changes: 4 additions & 5 deletions tests/ci/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,9 +1248,7 @@ def _configure_jobs(
for token_ in ci_controlling_tokens:
label_config = CI_CONFIG.get_label_config(token_)
assert label_config, f"Unknonwn token [{token_}]"
print(
f"NOTE: CI controlling token: [{ci_controlling_tokens}], add jobs: [{label_config.run_jobs}]"
)
print(f"NOTE: CI modifier: [{token_}], add jobs: [{label_config.run_jobs}]")
jobs_to_do_requested += label_config.run_jobs

# handle specific job requests
Expand All @@ -1264,7 +1262,7 @@ def _configure_jobs(
for job in requested_jobs:
job_with_parents = CI_CONFIG.get_job_with_parents(job)
print(
f"NOTE: CI controlling token: [#job_{job}], add jobs: [{job_with_parents}]"
f"NOTE: CI modifier: [#job_{job}], add jobs: [{job_with_parents}]"
)
# always add requested job itself, even if it could be skipped
jobs_to_do_requested.append(job_with_parents[0])
Expand All @@ -1273,6 +1271,7 @@ def _configure_jobs(
jobs_to_do_requested.append(parent)

if jobs_to_do_requested:
jobs_to_do_requested = list(set(jobs_to_do_requested))
print(
f"NOTE: Only specific job(s) were requested by commit message tokens: [{jobs_to_do_requested}]"
)
Expand Down Expand Up @@ -1408,7 +1407,7 @@ def _concurrent_create_status(job: str, batch: int, num_batches: int) -> None:


def _fetch_commit_tokens(message: str, pr_info: PRInfo) -> List[str]:
pattern = r"([^!]|^)#(\w+)"
pattern = r"(#|- \[x\] +<!---)(\w+)"
matches = [match[-1] for match in re.findall(pattern, message)]
res = [
match
Expand Down
46 changes: 45 additions & 1 deletion tests/ci/ci_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ class Labels(metaclass=WithIter):
NO_MERGE_COMMIT = "no_merge_commit"
NO_CI_CACHE = "no_ci_cache"
CI_SET_REDUCED = "ci_set_reduced"
CI_SET_FAST = "ci_set_fast"
CI_SET_ARM = "ci_set_arm"
CI_SET_INTEGRATION = "ci_set_integration"
CI_SET_ANALYZER = "ci_set_analyzer"
CI_SET_STATLESS = "ci_set_stateless"
CI_SET_STATEFUL = "ci_set_stateful"
CI_SET_STATLESS_ASAN = "ci_set_stateless_asan"
CI_SET_STATEFUL_ASAN = "ci_set_stateful_asan"

libFuzzer = "libFuzzer"

Expand Down Expand Up @@ -809,9 +814,15 @@ def validate(self) -> None:
CI_CONFIG = CIConfig(
label_configs={
Labels.DO_NOT_TEST_LABEL: LabelConfig(run_jobs=[JobNames.STYLE_CHECK]),
Labels.CI_SET_FAST: LabelConfig(
run_jobs=[
JobNames.STYLE_CHECK,
JobNames.FAST_TEST,
]
),
Labels.CI_SET_ARM: LabelConfig(
run_jobs=[
# JobNames.STYLE_CHECK,
JobNames.STYLE_CHECK,
Build.PACKAGE_AARCH64,
JobNames.INTEGRATION_TEST_ARM,
]
Expand All @@ -833,6 +844,38 @@ def validate(self) -> None:
JobNames.INTEGRATION_TEST_ASAN_ANALYZER,
]
),
Labels.CI_SET_STATLESS: LabelConfig(
run_jobs=[
JobNames.STYLE_CHECK,
JobNames.FAST_TEST,
Build.PACKAGE_RELEASE,
JobNames.STATELESS_TEST_RELEASE,
]
),
Labels.CI_SET_STATLESS_ASAN: LabelConfig(
run_jobs=[
JobNames.STYLE_CHECK,
JobNames.FAST_TEST,
Build.PACKAGE_ASAN,
JobNames.STATELESS_TEST_ASAN,
]
),
Labels.CI_SET_STATEFUL: LabelConfig(
run_jobs=[
JobNames.STYLE_CHECK,
JobNames.FAST_TEST,
Build.PACKAGE_RELEASE,
JobNames.STATEFUL_TEST_RELEASE,
]
),
Labels.CI_SET_STATEFUL_ASAN: LabelConfig(
run_jobs=[
JobNames.STYLE_CHECK,
JobNames.FAST_TEST,
Build.PACKAGE_ASAN,
JobNames.STATEFUL_TEST_ASAN,
]
),
Labels.CI_SET_REDUCED: LabelConfig(
run_jobs=[
job
Expand All @@ -844,6 +887,7 @@ def validate(self) -> None:
"tsan",
"msan",
"ubsan",
"coverage",
# skip build report jobs as not all builds will be done
"build check",
)
Expand Down

0 comments on commit 7d7025a

Please sign in to comment.