From 42d0041bd6509a619f233f68c5793404e01c9860 Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Tue, 9 Apr 2024 10:37:16 +0900 Subject: [PATCH 1/2] Test codecov token --- .github/workflows/test.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0193033..5e35e6e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,17 +20,16 @@ on: jobs: test: - uses: pion/.goassets/.github/workflows/test.reusable.yml@master + uses: pion/.goassets/.github/workflows/test.reusable.yml@codecov-token-test strategy: matrix: go: ["1.22", "1.21"] # auto-update/supported-go-version-list fail-fast: false with: go-version: ${{ matrix.go }} - codecov-token: ${{ env.CODECOV_TOKEN }} test-i386: - uses: pion/.goassets/.github/workflows/test-i386.reusable.yml@master + uses: pion/.goassets/.github/workflows/test-i386.reusable.yml@codecov-token-test strategy: matrix: go: ["1.22", "1.21"] # auto-update/supported-go-version-list @@ -39,7 +38,6 @@ jobs: go-version: ${{ matrix.go }} test-wasm: - uses: pion/.goassets/.github/workflows/test-wasm.reusable.yml@master + uses: pion/.goassets/.github/workflows/test-wasm.reusable.yml@codecov-token-test with: go-version: "1.22" # auto-update/latest-go-version - codecov-token: ${{ env.CODECOV_TOKEN }} From 87c30814f5f3e96e76f61272090c59d4788b527e Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Tue, 9 Apr 2024 10:58:59 +0900 Subject: [PATCH 2/2] Add code to be covered by test --- dummy.go | 11 +++++++++++ dummy_test.go | 2 ++ 2 files changed, 13 insertions(+) diff --git a/dummy.go b/dummy.go index 37baf39..add3e06 100644 --- a/dummy.go +++ b/dummy.go @@ -17,3 +17,14 @@ var ErrDummy = errors.New("dummy") type PublicAPI struct { PublicMember int } + +func (p *PublicAPI) PublicFunc() { + println("Running PublicAPI.PublicFunc") + println("PublicAPI.PublicMember: ", p.PublicMember) + if p.PublicMember == 1 { + println("PublicAPI.PublicMember is one") + } + if p.PublicMember != 1 { + println("PublicAPI.PublicMember is not one") + } +} diff --git a/dummy_test.go b/dummy_test.go index 95ff4c9..a4d155d 100644 --- a/dummy_test.go +++ b/dummy_test.go @@ -10,4 +10,6 @@ import ( ) func TestDummy(*testing.T) { + p := &PublicAPI{} + p.PublicFunc() }