Skip to content
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

Add "fast fail" option #131

Open
8 tasks
alfinkel opened this issue Jan 5, 2022 · 0 comments
Open
8 tasks

Add "fast fail" option #131

alfinkel opened this issue Jan 5, 2022 · 0 comments
Labels
cli CLI related issue documentation Improvements or additions to documentation enhancement New feature or request runners Runners related issue

Comments

@alfinkel
Copy link
Contributor

alfinkel commented Jan 5, 2022

Overview

Adding a fast fail option when fetching and/or checking allows for the stop abruptly when an error is encountered during execution rather than continuing on with processing. This feature allows a user to ensure that reports are generated, fixers executed, remote locker is updated and notifications are sent ONLY if all tests (fetchers and checks) have not errored. Failing (not erroring) checks are still valid.

Requirements

  • Add a "fast fail" option that aborts the current execution immediately (upon first encountered/unexpected error)
  • When "fast fail" is invoked evidence is not committed or pushed to the remote evidence locker
  • When "fast fail" is invoked notifiers will not fire
  • The "fast fail" option will work on a fetcher execution
  • The "fast fail" option will work on a check execution
  • The "fast fail" option will work on a combined fetcher/check execution
  • Current functionality will not be compromised
  • Include documentation for "fast fail"

Approach

  • Add --fastfail to CLI options.
  • Update runner logic to immediately stop execution when an unexpected error is encountered during a test suite execution.
    • Add a fast fail result class for both fetcher and check execution that will stop execution upon first unexpected error.
      • Reference: fetcher test result class
      • Reference: check test result class
      • Leverage unittest.TextTestResult functionality to stop execution upon unexpected error. One possible route for a "fast fail" fetcher test result class would be to set shouldStop to True inside of a stopTest method when a non-dependency chaining error is encountred during the fetch. Similar can be done for a "fast fail" check test result class although here you would not need to guard against a dependency chaining error.
    • Provide different "fast fail" result classes to runners when --fastfail option is used.
  • Update CLI execution process to bypass check execution if an error is encountered during a fetcher processing. This is only applicable when fetchers and checks are executed as part of a single command execution.
  • Update documentation by providing content about the "fast fail" option. Content should include "fast fail" behavior for fetchers, checks and fetchers/checks combined. Provide details on the state of the local locker when execution is aborted due to "fast fail".

Security and Privacy

N/A

Test Plan

  • Test fetcher only execution
  • Test check only execution (If a check errors further processing (reports, fixers, notifiers) will not run)
  • Test combined fetcher/check execution
    • If a fetcher errors then no checks are to run
    • If a check errors further processing (reports, fixers, notifiers) will not run
  • Ensure current functionality is not changed when not using the --fastfail option
@alfinkel alfinkel added documentation Improvements or additions to documentation enhancement New feature or request runners Runners related issue cli CLI related issue labels Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli CLI related issue documentation Improvements or additions to documentation enhancement New feature or request runners Runners related issue
Projects
None yet
Development

No branches or pull requests

1 participant