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