Skip to content

Commit ff7bcb1

Browse files
committed
fix fail test with cover flag
Signed-off-by: Fedor Partanskiy <fedor.partanskiy@atme.com>
1 parent 9336215 commit ff7bcb1

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.github/workflows/verify-build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ jobs:
3737
name: Unit Tests
3838
needs: basic-checks
3939
runs-on: ${{ github.repository == 'hyperledger/fabric' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
40-
env:
41-
GOEXPERIMENT: nocoverageredesign
4240
steps:
4341
- uses: actions/checkout@v4
4442
with:

core/handlers/library/registry_plugin_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func buildPlugin(t *testing.T, dest, pkg string) {
4545
require.NoError(t, err, "Could not build plugin: "+string(output))
4646
}
4747

48-
func TestLoadAuthPlugin(t *testing.T) {
48+
func TestLoadAuthPluginNoCover(t *testing.T) {
4949
if noplugin {
5050
t.Skip("plugins disabled")
5151
}
@@ -65,7 +65,7 @@ func TestLoadAuthPlugin(t *testing.T) {
6565
require.True(t, endorser.invoked, "Expected filter to invoke endorser on invoke")
6666
}
6767

68-
func TestLoadDecoratorPlugin(t *testing.T) {
68+
func TestLoadDecoratorPluginNoCover(t *testing.T) {
6969
if noplugin {
7070
t.Skip("plugins disabled")
7171
}
@@ -86,7 +86,7 @@ func TestLoadDecoratorPlugin(t *testing.T) {
8686
require.True(t, proto.Equal(decoratedInput, testInput), "Expected chaincode input to remain unchanged")
8787
}
8888

89-
func TestEndorsementPlugin(t *testing.T) {
89+
func TestEndorsementPluginNoCover(t *testing.T) {
9090
if noplugin {
9191
t.Skip("plugins disabled")
9292
}
@@ -109,7 +109,7 @@ func TestEndorsementPlugin(t *testing.T) {
109109
require.Equal(t, []byte{1, 2, 3}, output)
110110
}
111111

112-
func TestValidationPlugin(t *testing.T) {
112+
func TestValidationPluginNoCover(t *testing.T) {
113113
if noplugin {
114114
t.Skip("plugins disabled")
115115
}

scripts/run-unit-tests.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,12 @@ run_tests() {
159159
local -a parallel
160160
while IFS= read -r pkg; do parallel+=("$pkg"); done < <(parallel_test_packages "$@")
161161
if [ "${#parallel[@]}" -ne 0 ]; then
162-
go test "${flags[@]}" "${race_flags[@]}" -tags "$GO_TAGS" "${parallel[@]}" -short -timeout=20m
162+
go test "${flags[@]}" "${race_flags[@]}" -tags "$GO_TAGS" "${parallel[@]}" -short -timeout=20m -skip=NoCover
163+
164+
echo "test with no coverage"
165+
unset flags[0]
166+
flags=("${flags[@]}")
167+
go test "${flags[@]}" "${race_flags[@]}" -tags "$GO_TAGS" "github.com/hyperledger/fabric/core/handlers/library" -short -timeout=20m -run=NoCover
163168
fi
164169
}
165170
}

0 commit comments

Comments
 (0)