From ccb0e89075d4a61dbf2076339d735b58b571ebaa Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Fri, 6 Dec 2019 10:12:58 +0530 Subject: [PATCH 1/3] fix no tests running --- .github/workflows/cli.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index f0ce60e..0de033f 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -35,14 +35,22 @@ jobs: with: ref: ${{ github.ref }} - - name: Install Dependencies + - name: Install Dependencies (Linux) + if: matrix.os == 'ubuntu-latest' run: | mkdir -p $GOPATH/bin curl -s https://api.github.com/repos/urfave/gfmrun/releases/latest | grep gfmrun-linux-amd64 | grep download | cut -d '"' -f 4 | wget -O $GOPATH/bin/gfmrun -i - npm install markdown-toc + - name: Install Dependencies (Mac) + if: matrix.os == 'ubuntu-latest' + run: | + mkdir -p $GOPATH/bin + curl -s https://api.github.com/repos/urfave/gfmrun/releases/latest | grep gfmrun-darwin-amd64 | grep download | cut -d '"' -f 4 | wget -O $GOPATH/bin/gfmrun -i - + npm install markdown-toc + - name: Run Tests (v1) - if: contains(github.ref, 'v1') + if: contains(github.base_ref, 'v1') run: | go run build.go vet go run build.go test @@ -50,7 +58,7 @@ jobs: go run build.go toc docs/v1/manual.md - name: Run Tests (v2) - if: contains(github.ref, 'master') + if: contains(github.base_ref, 'master') run: | go run build.go vet go run build.go test From 1a724c9d6e6966bef07579a36bae748e387944a7 Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Fri, 6 Dec 2019 10:13:18 +0530 Subject: [PATCH 2/3] revert log.Printf to t.Logf --- .github/workflows/cli.yml | 2 ++ app_test.go | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 0de033f..8ac3f80 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -40,6 +40,7 @@ jobs: run: | mkdir -p $GOPATH/bin curl -s https://api.github.com/repos/urfave/gfmrun/releases/latest | grep gfmrun-linux-amd64 | grep download | cut -d '"' -f 4 | wget -O $GOPATH/bin/gfmrun -i - + chmod +x $GOPATH/bin/gfmrun npm install markdown-toc - name: Install Dependencies (Mac) @@ -47,6 +48,7 @@ jobs: run: | mkdir -p $GOPATH/bin curl -s https://api.github.com/repos/urfave/gfmrun/releases/latest | grep gfmrun-darwin-amd64 | grep download | cut -d '"' -f 4 | wget -O $GOPATH/bin/gfmrun -i - + chmod +x $GOPATH/bin/gfmrun npm install markdown-toc - name: Run Tests (v1) diff --git a/app_test.go b/app_test.go index 7a02d65..e675eb2 100644 --- a/app_test.go +++ b/app_test.go @@ -1423,7 +1423,7 @@ func TestApp_Run_CommandWithSubcommandHasHelpTopic(t *testing.T) { } for _, flagSet := range subcommandHelpTopics { - log.Printf("==> checking with flags %v", flagSet) + t.Logf("==> checking with flags %v", flagSet) app := &App{} buf := new(bytes.Buffer) @@ -1613,7 +1613,7 @@ func TestApp_Run_Help(t *testing.T) { for _, args := range helpArguments { buf := new(bytes.Buffer) - log.Printf("==> checking with arguments %v", args) + t.Logf("==> checking with arguments %v", args) app := &App{ Name: "boom", @@ -1631,7 +1631,7 @@ func TestApp_Run_Help(t *testing.T) { } output := buf.String() - log.Printf("output: %q\n", buf.Bytes()) + t.Logf("output: %q\n", buf.Bytes()) if !strings.Contains(output, "boom - make an explosive entrance") { t.Errorf("want help to contain %q, did not: \n%q", "boom - make an explosive entrance", output) @@ -1645,7 +1645,7 @@ func TestApp_Run_Version(t *testing.T) { for _, args := range versionArguments { buf := new(bytes.Buffer) - log.Printf("==> checking with arguments %v", args) + t.Logf("==> checking with arguments %v", args) app := &App{ Name: "boom", @@ -1664,7 +1664,7 @@ func TestApp_Run_Version(t *testing.T) { } output := buf.String() - log.Printf("output: %q\n", buf.Bytes()) + t.Logf("output: %q\n", buf.Bytes()) if !strings.Contains(output, "0.1.0") { t.Errorf("want version to contain %q, did not: \n%q", "0.1.0", output) From bac545cf3dff3215ceccb898028fcda2b6a6e70f Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Fri, 6 Dec 2019 10:18:30 +0530 Subject: [PATCH 3/3] fix macos typo --- .github/workflows/cli.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 8ac3f80..d4f9cdb 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -44,12 +44,12 @@ jobs: npm install markdown-toc - name: Install Dependencies (Mac) - if: matrix.os == 'ubuntu-latest' - run: | - mkdir -p $GOPATH/bin - curl -s https://api.github.com/repos/urfave/gfmrun/releases/latest | grep gfmrun-darwin-amd64 | grep download | cut -d '"' -f 4 | wget -O $GOPATH/bin/gfmrun -i - - chmod +x $GOPATH/bin/gfmrun - npm install markdown-toc + if: matrix.os == 'macos-latest' + run: | + mkdir -p $GOPATH/bin + curl -s https://api.github.com/repos/urfave/gfmrun/releases/latest | grep gfmrun-darwin-amd64 | grep download | cut -d '"' -f 4 | wget -O $GOPATH/bin/gfmrun -i - + chmod +x $GOPATH/bin/gfmrun + npm install markdown-toc - name: Run Tests (v1) if: contains(github.base_ref, 'v1')