-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test group filter, run retries #638
Conversation
The pull request introduces several changes:
Concerns:
Additional suggestions: @@ -79,7 +79,14 @@ export async function runScriptWithExitCode(
) {
- const runRetry = Math.max(1, normalizeInt(options.runRetry) || 1)
+ const runRetry = Math.max(1, normalizeInt(options.runRetry || 1))
let exitCode = -1
for (let r = 0; r < runRetry; ++r) {
const res = await runScript(scriptId, files, options)
exitCode = res.exitCode
if (exitCode === 0) break
console.error(`run failed, retrying ${r + 1}/${runRetry}`)
}
process.exit(exitCode)
} This is to ensure that @@ -285,3 +285,14 @@ export function renderWithPrecision(
+
+export function tagFilter(tags: string[], tag: string) {
+ if (!tags?.length || !tag) return true
+ const ltag = tag.toLocaleLowerCase()
+ for (const t of tags) {
+ const lt = t.toLocaleLowerCase()
+ if (lt.startsWith(":!") && ltag.startsWith(lt.slice(2))) return false
+ else if (ltag.startsWith(t)) return true
+ }
+ return false
+} I suggest validating the case of the tags before comparison, or use a case-insensitive comparison method if available. Other than these minor issues, the changes look good to me. LGTM 🚀
|
USER_CANCELLED_ERROR_CODE, | ||
FILES_NOT_FOUND_ERROR_CODE, | ||
ANNOTATION_ERROR_CODE, | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UNRECOVERABLE_ERROR_CODES
constant includes 0
which is typically a success error code. This could lead to incorrect behavior if a successful operation is treated as an unrecoverable error.
generated by pr-review-commit
unrecoverable_error_codes
.option("-ae, --apply-edits", "apply file edits") | ||
.option( | ||
"--vars <namevalue...>", | ||
"variables, as name=value, stored in env.vars" | ||
) | ||
.option("-rr, --run-retry <number>", "number of retries for the entire run") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The option "-rr, --run-retry " is missing a description.
generated by pr-review-commit
missing_argument
.option( | ||
"--groups <groups...>", | ||
"groups to include or exclude. Use :! prefix to exclude" | ||
) | ||
.action(scriptsTest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The option "--groups <groups...>" is missing a description.
generated by pr-review-commit
missing_argument
Making the test suite more robust
csv-separator
now supports a shorthand flag-cs
run-retry
flag has been added with shorthand-rr
.run-retry
.groups
flag—to perform categorical filter operations. Filtering can be reversed by using the:!
prefix.vision
tag.packages/sample
'spackage.json
to exclude vision tests during script testing.