From 456186fd0aabad52dde6385a9c8486684900e39e Mon Sep 17 00:00:00 2001 From: xfrr Date: Fri, 29 Sep 2023 17:55:03 +0200 Subject: [PATCH] remove circleci --- .github/workflows/build_and_test.yml | 6 ++-- .gitignore | 5 ++-- README.md | 3 +- e2e/test_results/.gitkeep | 0 e2e/transcoding_test.go | 41 ---------------------------- examples/test_results/.gitkeep | 0 transcoder/transcoder.go | 6 ++-- 7 files changed, 10 insertions(+), 51 deletions(-) create mode 100644 e2e/test_results/.gitkeep create mode 100644 examples/test_results/.gitkeep diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 09e7dc4..d21d79a 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -1,9 +1,9 @@ -name: Go +name: Build & Test on: push: - branches: [main] + branches: [master] pull_request: - branches: [main] + branches: [master] jobs: build: diff --git a/.gitignore b/.gitignore index 37f5172..f9aa2a4 100644 --- a/.gitignore +++ b/.gitignore @@ -25,5 +25,6 @@ coverage.out .vscode .idea -# test results -test_results +# Test results +*/test_results/* +!*.gitkeep diff --git a/README.md b/README.md index f49a8b3..e655bb4 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ # Goffmpeg [![Codacy Badge](https://api.codacy.com/project/badge/Grade/93e018e5008b4439acbb30d715b22e7f)](https://www.codacy.com/app/francisco.romero/goffmpeg?utm_source=github.com&utm_medium=referral&utm_content=xfrr/goffmpeg&utm_campaign=Badge_Grade) -[![CircleCI](https://dl.circleci.com/status-badge/img/gh/xfrr/goffmpeg/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/xfrr/goffmpeg/tree/master) [![Go Report Card](https://goreportcard.com/badge/github.com/xfrr/goffmpeg)](https://goreportcard.com/report/github.com/xfrr/goffmpeg) [![GoDoc](https://godoc.org/github.com/xfrr/goffmpeg?status.svg)](https://godoc.org/github.com/xfrr/goffmpeg) -[![License](https://img.shields.io/badge/License-MIT-blue.svg)]( +[![License](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE) FFMPEG wrapper written in GO diff --git a/e2e/test_results/.gitkeep b/e2e/test_results/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/e2e/transcoding_test.go b/e2e/transcoding_test.go index 6b30f6c..e74421f 100755 --- a/e2e/transcoding_test.go +++ b/e2e/transcoding_test.go @@ -1,10 +1,8 @@ package test import ( - "io/ioutil" "os/exec" "path" - "sync" "testing" "github.com/stretchr/testify/assert" @@ -53,45 +51,6 @@ func TestTranscodingProgress(t *testing.T) { checkFileExists(t, outputPath) } -func TestTranscodePipes(t *testing.T) { - createResultsDir(t) - - c1 := exec.Command("cat", input3gp) - - trans := new(transcoder.Transcoder) - - err := trans.InitializeEmptyTranscoder() - assert.Nil(t, err) - - w, err := trans.CreateInputPipe() - assert.Nil(t, err) - c1.Stdout = w - - r, err := trans.CreateOutputPipe("mp4") - assert.Nil(t, err) - - wg := &sync.WaitGroup{} - wg.Add(1) - go func() { - _, err := ioutil.ReadAll(r) - assert.Nil(t, err) - - r.Close() - wg.Done() - }() - - go func() { - err := c1.Run() - assert.Nil(t, err) - w.Close() - }() - done := trans.Run(false) - err = <-done - assert.Nil(t, err) - - wg.Wait() -} - func createResultsDir(t *testing.T) { err := exec.Command("mkdir", "-p", resultsPath).Run() assert.Nil(t, err) diff --git a/examples/test_results/.gitkeep b/examples/test_results/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/transcoder/transcoder.go b/transcoder/transcoder.go index 51c8254..9288bdb 100644 --- a/transcoder/transcoder.go +++ b/transcoder/transcoder.go @@ -263,12 +263,12 @@ func (t *Transcoder) Run(progress bool) <-chan error { } err = proc.Wait() - - go t.closePipes() - if err != nil { err = fmt.Errorf("failed finish ffmpeg (%s) with %s message %s %s", command, err, outb.String(), errb.String()) } + + go t.closePipes() + done <- err close(done) }(err)