Skip to content

Commit 9c5f815

Browse files
ansh808sxmnlab
andauthored
feat: Add ignore error task option to continue execution on task failure (#195)
--------- Co-authored-by: Ivan Ogasawara <ivan.ogasawara@gmail.com>
1 parent c61a480 commit 9c5f815

6 files changed

Lines changed: 513 additions & 79 deletions

File tree

.github/workflows/main.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,12 @@ jobs:
150150
- name: Run smoke test for testing args validation
151151
run: makim smoke-tests.arg-validation
152152

153+
- name: Run smoke test for testing ignore errors option
154+
run: makim smoke-tests.ignore-error-option
155+
153156
- name: Semantic Release PR Title Check
154157
uses: osl-incubator/semantic-release-pr-title-check@v1.4.1
155-
if: success() || failure()
158+
if: ${{ always() }}
156159
with:
157160
convention-name: conventionalcommits
158161

.makim.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ groups:
100100
- task: smoke-tests.validate-conditionals
101101
- task: smoke-tests.failure-hook
102102
- task: smoke-tests.arg-validation
103+
- task: smoke-tests.ignore-error-option
103104

104105
ci:
105106
help: Run all tasks used on CI
@@ -603,6 +604,31 @@ groups:
603604
makim $VERBOSE_FLAG --file $MAKIM_FILE tests.integer-validations --age=6
604605
makim $VERBOSE_FLAG --file $MAKIM_FILE tests.string-validations --name=makim
605606
607+
ignore-error-option:
608+
help: Test makim tasks with ignore error
609+
args:
610+
verbose-mode:
611+
help: Run the all the tests in verbose mode
612+
type: bool
613+
action: store_true
614+
env:
615+
MAKIM_FILE: tests/smoke/.makim-skip-errors.yaml
616+
backend: bash
617+
hooks:
618+
post-run:
619+
- task: clean.tmp
620+
run: |
621+
set -euo pipefail
622+
export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}'
623+
makim $VERBOSE_FLAG --file $MAKIM_FILE --help
624+
makim $VERBOSE_FLAG --file $MAKIM_FILE --version
625+
makim $VERBOSE_FLAG --file $MAKIM_FILE tests.test-simple-ignore-error
626+
makim $VERBOSE_FLAG --file $MAKIM_FILE tests.test-retry-ignore-error
627+
makim $VERBOSE_FLAG --file $MAKIM_FILE tests.test-ignore-error-with-hook
628+
makim $VERBOSE_FLAG --file $MAKIM_FILE tests.test-retry-failure-ignore
629+
makim $VERBOSE_FLAG --file $MAKIM_FILE tests.test-pre-run-hooks
630+
makim $VERBOSE_FLAG --file $MAKIM_FILE tests.test-post-run-hooks
631+
606632
error:
607633
help: This group helps tests failure tasks
608634
tasks:

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ select = [
109109
"I001", # isort
110110
"I002", # isort
111111
]
112-
ignore = ["RUF012"]
112+
ignore = [
113+
"RUF012",
114+
"PLR0915", # too many statements
115+
]
113116

114117
[tool.ruff.lint.pydocstyle]
115118
convention = "numpy"

0 commit comments

Comments
 (0)