-
Notifications
You must be signed in to change notification settings - Fork 0
Jules was unable to complete the task in time. Please review the work… #88
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,9 +64,7 @@ def run_unit_tests(self, coverage: bool = False, verbose: bool = False) -> bool: | |
| logger.error(f"Unit tests failed with exit code {e.returncode}") | ||
| return False | ||
|
|
||
| def run_integration_tests( | ||
| self, coverage: bool = False, verbose: bool = False | ||
| ) -> bool: | ||
| def run_integration_tests(self, coverage: bool = False, verbose: bool = False) -> bool: | ||
| """Run integration tests.""" | ||
| logger.info("Running integration tests...") | ||
|
|
||
|
|
@@ -160,9 +158,7 @@ def run_performance_tests( | |
| self, duration: int = 60, users: int = 10, verbose: bool = False | ||
| ) -> bool: | ||
| """Run performance tests.""" | ||
| logger.info( | ||
| f"Running performance tests with {users} users for {duration} seconds..." | ||
| ) | ||
| logger.info(f"Running performance tests with {users} users for {duration} seconds...") | ||
|
|
||
| # Ensure test dependencies are installed | ||
| if not self.env_manager.setup_environment_for_stage("test"): | ||
|
|
@@ -227,9 +223,7 @@ def run_security_tests( | |
| except subprocess.CalledProcessError: | ||
| logger.info("OWASP ZAP Python API not found, installing...") | ||
| try: | ||
| subprocess.check_call( | ||
| [python, "-m", "pip", "install", "python-owasp-zap-v2.4"] | ||
| ) | ||
| subprocess.check_call([python, "-m", "pip", "install", "python-owasp-zap-v2.4"]) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. security (dangerous-subprocess-use-audit): Detected subprocess function 'check_call' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'. Source: opengrep |
||
| except subprocess.CalledProcessError as e: | ||
| logger.error(f"Failed to install OWASP ZAP Python API: {e}") | ||
| return False | ||
|
|
@@ -286,9 +280,7 @@ def run_tests_for_stage( | |
| elif stage == "test": | ||
| return self.run_all_tests(coverage, verbose) | ||
| elif stage == "staging": | ||
| return self.run_integration_tests(coverage, verbose) and self.run_api_tests( | ||
| verbose | ||
| ) | ||
| return self.run_integration_tests(coverage, verbose) and self.run_api_tests(verbose) | ||
| elif stage == "prod": | ||
| return self.run_e2e_tests(True, verbose) | ||
| else: | ||
|
|
@@ -306,21 +298,15 @@ def parse_arguments() -> argparse.Namespace: | |
|
|
||
| # Test type arguments | ||
| parser.add_argument("--unit", action="store_true", help="Run unit tests") | ||
| parser.add_argument( | ||
| "--integration", action="store_true", help="Run integration tests" | ||
| ) | ||
| parser.add_argument("--integration", action="store_true", help="Run integration tests") | ||
| parser.add_argument("--api", action="store_true", help="Run API tests") | ||
| parser.add_argument("--e2e", action="store_true", help="Run end-to-end tests") | ||
| parser.add_argument( | ||
| "--performance", action="store_true", help="Run performance tests" | ||
| ) | ||
| parser.add_argument("--performance", action="store_true", help="Run performance tests") | ||
| parser.add_argument("--security", action="store_true", help="Run security tests") | ||
| parser.add_argument("--all", action="store_true", help="Run all tests") | ||
|
|
||
| # Test configuration | ||
| parser.add_argument( | ||
| "--coverage", action="store_true", help="Generate coverage report" | ||
| ) | ||
| parser.add_argument("--coverage", action="store_true", help="Generate coverage report") | ||
| parser.add_argument("--verbose", action="store_true", help="Enable verbose output") | ||
| parser.add_argument( | ||
| "--stage", | ||
|
|
@@ -357,11 +343,7 @@ def main() -> int: | |
|
|
||
| # Determine which tests to run | ||
| if args.stage: | ||
| return ( | ||
| 0 | ||
| if test_stages.run_tests_for_stage(args.stage, args.coverage, args.verbose) | ||
| else 1 | ||
| ) | ||
| return 0 if test_stages.run_tests_for_stage(args.stage, args.coverage, args.verbose) else 1 | ||
|
|
||
| if args.all: | ||
| return 0 if test_stages.run_all_tests(args.coverage, args.verbose) else 1 | ||
|
|
@@ -373,9 +355,7 @@ def main() -> int: | |
| success = test_stages.run_unit_tests(args.coverage, args.verbose) and success | ||
|
|
||
| if args.integration: | ||
| success = ( | ||
| test_stages.run_integration_tests(args.coverage, args.verbose) and success | ||
| ) | ||
| success = test_stages.run_integration_tests(args.coverage, args.verbose) and success | ||
|
|
||
| if args.api: | ||
| success = test_stages.run_api_tests(args.verbose) and success | ||
|
|
@@ -385,8 +365,7 @@ def main() -> int: | |
|
|
||
| if args.performance: | ||
| success = ( | ||
| test_stages.run_performance_tests(args.duration, args.users, args.verbose) | ||
| and success | ||
| test_stages.run_performance_tests(args.duration, args.users, args.verbose) and success | ||
| ) | ||
|
|
||
| if args.security: | ||
|
|
||
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.
suggestion (code-quality): Replace if-expression with
or(or-if-exp-identity)Explanation
Here we find ourselves setting a value if it evaluates toTrue, and otherwiseusing a default.
The 'After' case is a bit easier to read and avoids the duplication of
input_currency.It works because the left-hand side is evaluated first. If it evaluates to
true then
currencywill be set to this and the right-hand side will not beevaluated. If it evaluates to false the right-hand side will be evaluated and
currencywill be set toDEFAULT_CURRENCY.