Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleFromNVIDIA committed Aug 28, 2024
1 parent 5bbc779 commit b2efc79
Showing 1 changed file with 59 additions and 1 deletion.
60 changes: 59 additions & 1 deletion test/rapids_pre_commit_hooks/test_pr_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,66 @@ def test_check_jobs_first_job(content, pr_builder_index, warnings):
),
],
),
(
dedent(
"""\
jobs:
pr-builder:
needs:
- other-job-1
- other-job-2
other-job-1: {}
other-job-2: {}
other-job-3: {}
"""
),
["other-job-3"],
[],
),
(
dedent(
"""\
jobs:
pr-builder:
needs:
- other-job-1
- other-job-2
- other-job-3
other-job-1: {}
other-job-2: {}
other-job-3: {}
"""
),
["other-job-3"],
[
LintWarning(
(24, 29),
"'pr-builder' job should depend on all other jobs in the order "
"they appear",
notes=[
Note(
(24, 29),
"to ignore a job dependency, pass it as "
"--ignore-dependency",
),
],
replacements=[
Replacement(
(37, 90),
"- other-job-1\n - other-job-2",
),
],
),
],
),
],
ids=[
"correct",
"unsorted",
"missing",
"ignore-dependencies-correct",
"ignore-dependencies-extra",
],
ids=["correct", "unsorted", "missing"],
)
def test_check_other_jobs(content, ignore_dependencies, warnings):
linter = Linter(".github/workflows/pr.yaml", content)
Expand Down

0 comments on commit b2efc79

Please sign in to comment.