2020-06-02 22:48:55 +08:00
|
|
|
package e2e
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
2023-02-27 14:44:16 +08:00
|
|
|
_ "github.com/onsi/ginkgo/v2"
|
2020-09-07 14:57:23 +08:00
|
|
|
|
2022-08-29 01:02:53 +08:00
|
|
|
"github.com/fatedier/frp/pkg/util/log"
|
2020-09-07 14:57:23 +08:00
|
|
|
// test source
|
|
|
|
_ "github.com/fatedier/frp/test/e2e/basic"
|
2021-06-20 23:57:41 +08:00
|
|
|
_ "github.com/fatedier/frp/test/e2e/features"
|
2022-08-29 01:02:53 +08:00
|
|
|
"github.com/fatedier/frp/test/e2e/framework"
|
2020-09-07 14:57:23 +08:00
|
|
|
_ "github.com/fatedier/frp/test/e2e/plugin"
|
2020-06-02 22:48:55 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
// handleFlags sets up all flags and parses the command line.
|
|
|
|
func handleFlags() {
|
|
|
|
framework.RegisterCommonFlags(flag.CommandLine)
|
|
|
|
flag.Parse()
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
|
|
|
// Register test flags, then parse flags.
|
|
|
|
handleFlags()
|
|
|
|
|
|
|
|
if err := framework.ValidateTestContext(&framework.TestContext); err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
2023-09-06 10:18:02 +08:00
|
|
|
log.InitLog("console", framework.TestContext.LogLevel, 0, true)
|
2020-06-02 22:48:55 +08:00
|
|
|
os.Exit(m.Run())
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestE2E(t *testing.T) {
|
|
|
|
RunE2ETests(t)
|
|
|
|
}
|