diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index e50394fa..25b3254e 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -122,7 +122,7 @@ jobs: echo "Wait for service ready." && make -j -C test && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=true -init-self-signed-cert=true \ -check-api-secret=true -test.run TestSystem_Empty && @@ -131,19 +131,19 @@ jobs: echo "Test HTTP service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Test HTTPS service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint https://localhost:2443 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint https://localhost:2443 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Run media test with retry" && bash scripts/tools/secret.sh --output test/.env && - ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -test.run WithStream ret=$?; echo "Test result: $ret" @@ -194,7 +194,7 @@ jobs: echo "Wait for service ready." && make -j -C test && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=true -init-self-signed-cert=true \ -check-api-secret=true -test.run TestSystem_Empty && @@ -203,19 +203,19 @@ jobs: echo "Test HTTP service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Test HTTPS service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint https://localhost:2443 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint https://localhost:2443 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Run media test with retry" && bash scripts/tools/secret.sh --output test/.env && - ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -test.run WithStream ret=$?; echo "Test result: $ret" @@ -284,7 +284,7 @@ jobs: echo "Wait for service ready." && make -j -C test && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=true -init-self-signed-cert=true \ -check-api-secret=true -test.run TestSystem_Empty && @@ -293,19 +293,19 @@ jobs: echo "Test HTTP service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Test HTTPS service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint https://localhost:2443 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint https://localhost:2443 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Run media test with retry" && bash scripts/tools/secret.sh --output test/.env && - ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -test.run WithStream ret=$?; echo "Test result: $ret" @@ -373,7 +373,7 @@ jobs: echo "Wait for service ready." && make -j -C test && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=true -init-self-signed-cert=true \ -check-api-secret=true -test.run TestSystem_Empty && @@ -382,19 +382,19 @@ jobs: echo "Test HTTP service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Test HTTPS service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint https://localhost:2443 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint https://localhost:2443 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Run media test with retry" && bash scripts/tools/secret.sh --output test/.env && - ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -test.run WithStream ret=$?; echo "Test result: $ret" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8ccd1862..65fb8b6e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -91,7 +91,7 @@ jobs: echo "Wait for service ready." && make -j -C test && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=true -init-self-signed-cert=true \ -check-api-secret=true -test.run TestSystem_Empty && @@ -100,19 +100,19 @@ jobs: echo "Test HTTP service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Test HTTPS service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint https://localhost:2443 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint https://localhost:2443 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Run media test with retry" && bash scripts/tools/secret.sh --output test/.env && - ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ + ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -test.run WithStream ret=$?; echo "Test result: $ret" @@ -259,7 +259,7 @@ jobs: echo "Wait for service ready." && make -j -C test && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://srs.stack.local:80 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://srs.stack.local:80 \ -srs-log=true -wait-ready=true -init-password=true -init-self-signed-cert=true \ -check-api-secret=true -test.run TestSystem_Empty && @@ -268,19 +268,19 @@ jobs: echo "Test HTTP service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://srs.stack.local:80 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://srs.stack.local:80 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Test HTTPS service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint https://srs.stack.local:443 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint https://srs.stack.local:443 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Run media test with retry" && bash scripts/tools/secret.sh --output test/.env && - ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.v -endpoint http://srs.stack.local:80 \ + ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://srs.stack.local:80 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -test.run WithStream ret=$?; echo "Test result: $ret" @@ -424,7 +424,7 @@ jobs: echo "Wait for service ready." && make -j -C test && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://srs.stack.local:80 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://srs.stack.local:80 \ -srs-log=true -wait-ready=true -init-password=true -init-self-signed-cert=true \ -check-api-secret=true -test.run TestSystem_Empty && @@ -433,19 +433,19 @@ jobs: echo "Test HTTP service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint http://srs.stack.local:80 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://srs.stack.local:80 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Test HTTPS service." && bash scripts/tools/secret.sh --output test/.env && - ./test/oryx.test -test.timeout=1h -test.v -endpoint https://srs.stack.local:443 \ + ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint https://srs.stack.local:443 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -no-media-test && echo "Run media test with retry" && bash scripts/tools/secret.sh --output test/.env && - ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.v -endpoint http://srs.stack.local:80 \ + ./scripts/tools/failed-retry.sh 3 ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://srs.stack.local:80 \ -srs-log=true -wait-ready=true -init-password=false -init-self-signed-cert=false \ -check-api-secret=true -test.run WithStream ret=$?; echo "Test result: $ret" diff --git a/DEVELOPER.md b/DEVELOPER.md index 6e02edcb..34a59bd7 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -39,8 +39,8 @@ Run all tests: ```bash bash scripts/tools/secret.sh --output test/.env && -(cd test && go test -timeout=1h -v --endpoint=http://localhost:2022 -init-self-signed-cert=true) && -(cd test && go test -timeout=1h -v --endpoint=https://localhost:2443 -init-self-signed-cert=false) +(cd test && go test -timeout=1h -failfast -v --endpoint=http://localhost:2022 -init-self-signed-cert=true) && +(cd test && go test -timeout=1h -failfast -v --endpoint=https://localhost:2443 -init-self-signed-cert=false) ``` Run the platform react ui, or run in WebStorm: @@ -152,14 +152,14 @@ Run test for script: rm -f test/oryx.test && docker exec -it script make -j -C test && bash scripts/tools/secret.sh --output test/.env && sleep 5 && -docker exec -it script ./test/oryx.test -test.timeout=1h -test.v -endpoint http://localhost:2022 \ +docker exec -it script ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=true -check-api-secret=true -init-self-signed-cert=true \ -test.run TestSystem_Empty && bash scripts/tools/secret.sh --output test/.env && -docker exec -it script ./test/oryx.test -test.timeout=1h -test.v -wait-ready -endpoint http://localhost:2022 \ +docker exec -it script ./test/oryx.test -test.timeout=1h -test.failfast -test.v -wait-ready -endpoint http://localhost:2022 \ -srs-log=true -wait-ready=true -init-password=false -check-api-secret=true \ -test.parallel 3 && -docker exec -it script ./test/oryx.test -test.timeout=1h -test.v -wait-ready -endpoint https://localhost:2443 \ +docker exec -it script ./test/oryx.test -test.timeout=1h -test.failfast -test.v -wait-ready -endpoint https://localhost:2443 \ -srs-log=true -wait-ready=true -init-password=false -check-api-secret=true \ -test.parallel 3 ``` @@ -247,14 +247,14 @@ Run test for aaPanel: rm -f test/oryx.test && docker exec -it aapanel make -j -C test && bash scripts/tools/secret.sh --output test/.env && -docker exec -it aapanel ./test/oryx.test -test.timeout=1h -test.v -endpoint http://srs.stack.local:80 \ +docker exec -it aapanel ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://srs.stack.local:80 \ -srs-log=true -wait-ready=true -init-password=true -check-api-secret=true -init-self-signed-cert=true \ -test.run TestSystem_Empty && bash scripts/tools/secret.sh --output test/.env && -docker exec -it aapanel ./test/oryx.test -test.timeout=1h -test.v -wait-ready -endpoint http://srs.stack.local:80 \ +docker exec -it aapanel ./test/oryx.test -test.timeout=1h -test.failfast -test.v -wait-ready -endpoint http://srs.stack.local:80 \ -srs-log=true -wait-ready=true -init-password=false -check-api-secret=true \ -test.parallel 3 && -docker exec -it aapanel ./test/oryx.test -test.timeout=1h -test.v -wait-ready -endpoint https://srs.stack.local:443 \ +docker exec -it aapanel ./test/oryx.test -test.timeout=1h -test.failfast -test.v -wait-ready -endpoint https://srs.stack.local:443 \ -srs-log=true -wait-ready=true -init-password=false -check-api-secret=true \ -test.parallel 3 ``` @@ -351,14 +351,14 @@ Run test for BT: rm -f test/oryx.test && docker exec -it bt make -j -C test && bash scripts/tools/secret.sh --output test/.env && -docker exec -it bt ./test/oryx.test -test.timeout=1h -test.v -endpoint http://srs.stack.local:80 \ +docker exec -it bt ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://srs.stack.local:80 \ -srs-log=true -wait-ready=true -init-password=true -check-api-secret=true -init-self-signed-cert=true \ -test.run TestSystem_Empty && bash scripts/tools/secret.sh --output test/.env && -docker exec -it bt ./test/oryx.test -test.timeout=1h -test.v -wait-ready -endpoint http://srs.stack.local:80 \ +docker exec -it bt ./test/oryx.test -test.timeout=1h -test.failfast -test.v -wait-ready -endpoint http://srs.stack.local:80 \ -srs-log=true -wait-ready=true -init-password=false -check-api-secret=true \ -test.parallel 3 && -docker exec -it bt ./test/oryx.test -test.timeout=1h -test.v -wait-ready -endpoint https://srs.stack.local:443 \ +docker exec -it bt ./test/oryx.test -test.timeout=1h -test.failfast -test.v -wait-ready -endpoint https://srs.stack.local:443 \ -srs-log=true -wait-ready=true -init-password=false -check-api-secret=true \ -test.parallel 3 ``` @@ -426,11 +426,11 @@ Test the droplet instance: ```bash ssh root@$SRS_DROPLET_EIP bash scripts/tools/secret.sh --output test/.env && -ssh root@$SRS_DROPLET_EIP ./test/oryx.test -test.timeout=1h -test.v -endpoint http://$SRS_DROPLET_EIP:2022 \ +ssh root@$SRS_DROPLET_EIP ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://$SRS_DROPLET_EIP:2022 \ -srs-log=true -wait-ready=true -init-password=true -check-api-secret=true -init-self-signed-cert=true \ -test.run TestSystem_Empty && sleep 3 && ssh root@$SRS_DROPLET_EIP bash scripts/tools/secret.sh --output test/.env && -ssh root@$SRS_DROPLET_EIP ./test/oryx.test -test.timeout=1h -test.v -wait-ready -endpoint http://$SRS_DROPLET_EIP:2022 \ +ssh root@$SRS_DROPLET_EIP ./test/oryx.test -test.timeout=1h -test.failfast -test.v -wait-ready -endpoint http://$SRS_DROPLET_EIP:2022 \ -endpoint-rtmp rtmp://$SRS_DROPLET_EIP -endpoint-http http://$SRS_DROPLET_EIP -endpoint-srt srt://$SRS_DROPLET_EIP:10080 \ -srs-log=true -wait-ready=true -init-password=false -check-api-secret=true \ -test.parallel 1 @@ -516,15 +516,15 @@ Test the CVM instance: ```bash $sshCmd ubuntu@$(cat .tmp/lh-ip2.txt) sudo bash scripts/tools/secret.sh --output test/.env && -$sshCmd ubuntu@$(cat .tmp/lh-ip2.txt) ./test/oryx.test -test.timeout=1h -test.v -endpoint http://$(cat .tmp/lh-ip2.txt):2022 \ +$sshCmd ubuntu@$(cat .tmp/lh-ip2.txt) ./test/oryx.test -test.timeout=1h -test.failfast -test.v -endpoint http://$(cat .tmp/lh-ip2.txt):2022 \ -srs-log=true -wait-ready=true -init-password=true -check-api-secret=true -init-self-signed-cert=true \ -test.run TestSystem_Empty && $sshCmd ubuntu@$(cat .tmp/lh-ip2.txt) sudo bash scripts/tools/secret.sh --output test/.env && -$sshCmd ubuntu@$(cat .tmp/lh-ip2.txt) ./test/oryx.test -test.timeout=1h -test.v -wait-ready -endpoint http://$(cat .tmp/lh-ip2.txt):2022 \ +$sshCmd ubuntu@$(cat .tmp/lh-ip2.txt) ./test/oryx.test -test.timeout=1h -test.failfast -test.v -wait-ready -endpoint http://$(cat .tmp/lh-ip2.txt):2022 \ -endpoint-rtmp rtmp://$(cat .tmp/lh-ip2.txt) -endpoint-http http://$(cat .tmp/lh-ip2.txt) -endpoint-srt srt://$(cat .tmp/lh-ip2.txt):10080 \ -srs-log=true -wait-ready=true -init-password=false -check-api-secret=true \ -test.parallel 3 && -ssh ubuntu@$(cat .tmp/lh-ip2.txt) ./test/oryx.test -test.timeout=1h -test.v -wait-ready -endpoint https://$(cat .tmp/lh-ip2.txt):2443 \ +ssh ubuntu@$(cat .tmp/lh-ip2.txt) ./test/oryx.test -test.timeout=1h -test.failfast -test.v -wait-ready -endpoint https://$(cat .tmp/lh-ip2.txt):2443 \ -endpoint-rtmp rtmp://$(cat .tmp/lh-ip2.txt) -endpoint-http https://$(cat .tmp/lh-ip2.txt) -endpoint-srt srt://$(cat .tmp/lh-ip2.txt):10080 \ -srs-log=true -wait-ready=true -init-password=false -check-api-secret=true \ -test.parallel 3 @@ -1158,6 +1158,7 @@ The following are the update records for the Oryx server. * Transcript: Support subtitle with WebVTT format. v5.14.12 * Transcript: Fix overlay transcoding parameters parsing bug. v5.14.13 * Use port 80/443 by default in README. v5.14.14 + * Use fastfail for test and utest. v5.14.15 * Rename project to Oryx.[v5.14.15](https://github.com/ossrs/oryx/releases/tag/v5.14.15) * v5.13: * Fix bug for vlive and transcript. v5.13.1 diff --git a/test/media_test.go b/test/media_test.go index b7aa780e..500f2827 100644 --- a/test/media_test.go +++ b/test/media_test.go @@ -299,7 +299,7 @@ func TestMedia_WithStream_PublishSrtPlayFlv_SecretQuery(t *testing.T) { } select { case <-ctx.Done(): - case <-time.After(time.Duration(*srsFFprobeTimeout) / 10 * time.Millisecond): + case <-time.After(time.Duration(*srsFFprobeTimeout) * time.Millisecond / 8): } // Start FFprobe to detect and verify stream.