From 74143174292e0a26d332745b3d1f27a5ef46153a Mon Sep 17 00:00:00 2001 From: scruzin Date: Wed, 10 Jul 2019 09:45:55 +0930 Subject: [PATCH] Skip TestFromFrame if RTMP_TEST_FRAME env var not defined. --- protocol/rtmp/rtmp_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/protocol/rtmp/rtmp_test.go b/protocol/rtmp/rtmp_test.go index e1e79796..f1b44554 100644 --- a/protocol/rtmp/rtmp_test.go +++ b/protocol/rtmp/rtmp_test.go @@ -173,6 +173,10 @@ func TestErorHandling(t *testing.T) { // TestFromFrame tests streaming from a single H.264 frame which is repeated. func TestFromFrame(t *testing.T) { testLog(0, "TestFromFrame") + testFrame := os.Getenv("RTMP_TEST_FRAME") + if testFrame == "" { + t.Skip("Skipping TestFromFrame since no RTMP_TEST_FRAME") + } if testKey == "" { t.Skip("Skipping TestFromFrame since no RTMP_TEST_KEY") } @@ -181,7 +185,6 @@ func TestFromFrame(t *testing.T) { t.Errorf("Dial failed with error: %v", err) } - testFrame := os.Getenv("RTMP_TEST_FRAME") b, err := ioutil.ReadFile(testFrame) if err != nil { t.Errorf("ReadFile failed with error: %v", err)