2019-10-29 20:54:47 +00:00
|
|
|
package main
|
|
|
|
|
2019-11-02 14:32:58 +00:00
|
|
|
import (
|
2020-04-05 12:37:21 +00:00
|
|
|
"os"
|
|
|
|
|
2019-11-02 14:32:58 +00:00
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
"github.com/spf13/cobra"
|
2020-04-05 12:37:21 +00:00
|
|
|
|
|
|
|
"github.com/authelia/authelia/internal/utils"
|
2019-11-02 14:32:58 +00:00
|
|
|
)
|
2019-10-29 20:54:47 +00:00
|
|
|
|
|
|
|
// RunUnitTest run the unit tests
|
|
|
|
func RunUnitTest(cobraCmd *cobra.Command, args []string) {
|
2019-11-16 19:50:58 +00:00
|
|
|
log.SetLevel(log.TraceLevel)
|
2019-11-24 19:01:58 +00:00
|
|
|
if err := utils.Shell("go test $(go list ./... | grep -v suites)").Run(); err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2019-12-27 11:07:53 +00:00
|
|
|
cmd := utils.Shell("yarn test")
|
2019-11-24 19:01:58 +00:00
|
|
|
cmd.Dir = "web"
|
|
|
|
cmd.Env = append(os.Environ(), "CI=true")
|
|
|
|
if err := cmd.Run(); err != nil {
|
2019-11-02 14:32:58 +00:00
|
|
|
log.Fatal(err)
|
2019-10-29 20:54:47 +00:00
|
|
|
}
|
|
|
|
}
|