[GODRIVER-2184] Use testing.Short to skip longer tests Created: 14/Oct/21 Updated: 19/Oct/22 Resolved: 02/Jun/22 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Testing |
| Affects Version/s: | None |
| Fix Version/s: | 1.10.0 |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Benji Rewis (Inactive) | Assignee: | Matt Dale |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Epic Link: | Improve Testing Suite |
| Quarter: | FY23Q4 |
| Description |
|
It's tough to test basic changes quickly as a patch can take up to 30 minutes. We should mark longer-running tests with testing.Short so we can skip them with the -short flag. |
| Comments |
| Comment by Matt Dale [ 02/Jun/22 ] | ||
|
Can now run all unit tests without a MongoDB server running in under 60s with:
or
| ||
| Comment by Githook User [ 02/Jun/22 ] | ||
|
Author: {'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}Message: | ||
| Comment by Matt Dale [ 21/Oct/21 ] | ||
|
Consider making mtest.New() skip the current test if -short is enabled. Most (all?) tests that call mtest.New() are integration tests and require a running MongoDB instance to work. In that case, calling go test -short ./... would run only the unit tests (we'd still have to manually skip some tests by checking for testing.Short(), but doing it in mtest.New() should cover a lot of cases). |