e2e_test.go 816 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package e2e
  2. import (
  3. "flag"
  4. "fmt"
  5. "os"
  6. "testing"
  7. "github.com/fatedier/frp/pkg/util/log"
  8. "github.com/fatedier/frp/test/e2e/framework"
  9. // test source
  10. _ "github.com/fatedier/frp/test/e2e/basic"
  11. _ "github.com/fatedier/frp/test/e2e/features"
  12. _ "github.com/fatedier/frp/test/e2e/plugin"
  13. _ "github.com/onsi/ginkgo"
  14. )
  15. // handleFlags sets up all flags and parses the command line.
  16. func handleFlags() {
  17. framework.RegisterCommonFlags(flag.CommandLine)
  18. flag.Parse()
  19. }
  20. func TestMain(m *testing.M) {
  21. // Register test flags, then parse flags.
  22. handleFlags()
  23. if err := framework.ValidateTestContext(&framework.TestContext); err != nil {
  24. fmt.Println(err)
  25. os.Exit(1)
  26. }
  27. log.InitLog("console", "", framework.TestContext.LogLevel, 0, true)
  28. os.Exit(m.Run())
  29. }
  30. func TestE2E(t *testing.T) {
  31. RunE2ETests(t)
  32. }