mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	test-backend: Default to running all tests.
This switches the default of the previous --nonfatal-errors option, and also moves to use the `-x | --stop` names used by the nose test framework.
This commit is contained in:
		@@ -44,12 +44,12 @@ URL coverage, and slow tests.  Use the `-h` option to discover these
 | 
				
			|||||||
features.  We also have a `--profile` option to facilitate profiling
 | 
					features.  We also have a `--profile` option to facilitate profiling
 | 
				
			||||||
tests.
 | 
					tests.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Another thing to note is that our tests generally "fail fast," i.e. they
 | 
					By default, `test-backend` will run all requested tests, and report
 | 
				
			||||||
stop at the first sign of trouble.  This is generally a good thing for
 | 
					all failures at the end. You can configure it to stop after the first
 | 
				
			||||||
iterative development, but you can override this behavior with the
 | 
					error with the `--stop` option (or `-x`).
 | 
				
			||||||
`--nonfatal-errors` option.  A useful option to combine with that is
 | 
					
 | 
				
			||||||
the `--rerun` option, which will rerun just the tests that failed in
 | 
					Another useful option is `--rerun`, which will rerun just the tests
 | 
				
			||||||
the last test run.
 | 
					that failed in the last test run.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Webhook integrations**.  For performance, `test-backend` with no
 | 
					**Webhook integrations**.  For performance, `test-backend` with no
 | 
				
			||||||
arguments will not run webhook integration tests (`zerver/webhooks/`),
 | 
					arguments will not run webhook integration tests (`zerver/webhooks/`),
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -223,10 +223,11 @@ def main() -> None:
 | 
				
			|||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    parser.add_argument(
 | 
					    parser.add_argument(
 | 
				
			||||||
        "--nonfatal-errors",
 | 
					        "-x",
 | 
				
			||||||
        action="store_false",
 | 
					        "--stop",
 | 
				
			||||||
 | 
					        action="store_true",
 | 
				
			||||||
        dest="fatal_errors",
 | 
					        dest="fatal_errors",
 | 
				
			||||||
        help="Continue past test failures to run all tests",
 | 
					        help="Stop running tests after the first failure.",
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
    parser.add_argument("--coverage", action="store_true", help="Compute test coverage.")
 | 
					    parser.add_argument("--coverage", action="store_true", help="Compute test coverage.")
 | 
				
			||||||
    parser.add_argument(
 | 
					    parser.add_argument(
 | 
				
			||||||
@@ -257,8 +258,7 @@ def main() -> None:
 | 
				
			|||||||
        "--rerun",
 | 
					        "--rerun",
 | 
				
			||||||
        action="store_true",
 | 
					        action="store_true",
 | 
				
			||||||
        help=(
 | 
					        help=(
 | 
				
			||||||
            "Run the tests which failed the last time "
 | 
					            "Run the tests which failed the last time " "test-backend was run.  Implies not --stop."
 | 
				
			||||||
            "test-backend was run.  Implies --nonfatal-errors."
 | 
					 | 
				
			||||||
        ),
 | 
					        ),
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
    parser.add_argument(
 | 
					    parser.add_argument(
 | 
				
			||||||
@@ -294,7 +294,7 @@ def main() -> None:
 | 
				
			|||||||
    # While running --rerun, we read var/last_test_failure.json to get
 | 
					    # While running --rerun, we read var/last_test_failure.json to get
 | 
				
			||||||
    # the list of tests that failed on the last run, and then pretend
 | 
					    # the list of tests that failed on the last run, and then pretend
 | 
				
			||||||
    # those tests were passed explicitly.  --rerun implies
 | 
					    # those tests were passed explicitly.  --rerun implies
 | 
				
			||||||
    # --nonfatal-errors, so that we don't end up removing tests from
 | 
					    # !fatal_errors, so that we don't end up removing tests from
 | 
				
			||||||
    # the list that weren't run.
 | 
					    # the list that weren't run.
 | 
				
			||||||
    if options.rerun:
 | 
					    if options.rerun:
 | 
				
			||||||
        parallel = 1
 | 
					        parallel = 1
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user