authelia/cmd/authelia-scripts/cmd_unittest.go
Amir Zarrinkafsh 3d312cf3b9
refactor: replace yarn with pnpm (#2424)
* Check for pnpm in authelia-scripts
* Improve husky hooks to check for required apps
* Use pnpm in coverage dockerfile
* Use pnpm in dev workflow
* Stop buildx log truncation
* Ignore pnpm lockfile in yamllint
* Update versions required for docker and docker-compose in contributing docs
2021-09-29 17:24:21 +10:00

29 lines
582 B
Go

package main
import (
"os"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/authelia/authelia/v4/internal/utils"
)
// RunUnitTest run the unit tests.
func RunUnitTest(cobraCmd *cobra.Command, args []string) {
log.SetLevel(log.TraceLevel)
if err := utils.Shell("go test -coverprofile=coverage.txt -covermode=atomic $(go list ./... | grep -v suites)").Run(); err != nil {
log.Fatal(err)
}
cmd := utils.Shell("pnpm test")
cmd.Dir = webDirectory
cmd.Env = append(os.Environ(), "CI=true")
if err := cmd.Run(); err != nil {
log.Fatal(err)
}
}