mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-02-01 22:47:40 +00:00
Allow filtering tests from mage (#1072)
This commit is contained in:
@@ -15,9 +15,9 @@ The project consists of:
|
||||
|
||||
### Backend (Go)
|
||||
- **Build**: `mage build` - Builds the Go binary
|
||||
- **Test**: `mage test:feature` - Runs feature tests
|
||||
- **Test Features**: `mage test:feature` - Runs feature tests
|
||||
- **Test Web**: `mage test:web` - Runs web tests
|
||||
- **Test All**: `mage test:all` - Runs all tests
|
||||
- You can run specific tests with `mage test:filter <filter>` where `<filter>` is a go test filter string.
|
||||
- **Lint**: `mage lint` - Runs golangci-lint
|
||||
- **Lint Fix**: `mage lint:fix` - Runs golangci-lint with auto-fix
|
||||
- **Generate Swagger Docs**: `mage generate:swagger-docs` - Updates API documentation (Generally you won't need to run this unless the user tells you to. It is updated automatically in the CI workflow)
|
||||
|
||||
11
magefile.go
11
magefile.go
@@ -396,7 +396,16 @@ func (Test) Coverage() {
|
||||
func (Test) Web() {
|
||||
mg.Deps(initVars)
|
||||
// We run everything sequentially and not in parallel to prevent issues with real test databases
|
||||
runAndStreamOutput("go", "test", Goflags[0], "-p", "1", "-timeout", "45m", PACKAGE+"/pkg/webtests")
|
||||
args := []string{"test", Goflags[0], "-p", "1", "-timeout", "45m", PACKAGE + "/pkg/webtests"}
|
||||
runAndStreamOutput("go", args...)
|
||||
}
|
||||
|
||||
func (Test) Filter(filter string) {
|
||||
mg.Deps(initVars)
|
||||
setApiPackages()
|
||||
// We run everything sequentially and not in parallel to prevent issues with real test databases
|
||||
args := append([]string{"test", Goflags[0], "-p", "1", "-timeout", "45m", "-run", filter}, ApiPackages...)
|
||||
runAndStreamOutput("go", args...)
|
||||
}
|
||||
|
||||
func (Test) All() {
|
||||
|
||||
Reference in New Issue
Block a user