From 24cae6e2ced1f838fdca08b010a5ac61fa366e1d Mon Sep 17 00:00:00 2001 From: Tore Martin Hagen Date: Tue, 3 Feb 2026 07:58:45 +0100 Subject: [PATCH] Added minimum _test.go files for files that does not have tests. We use the tool cover for coverage, but if there is no _test.go file, then Go use the tool covdata. At the same time, they removed covdata as a precompiled binary in the distribution. This made the coverage calculation fail for some of us. As described in this discussion https://github.com/golang/go/issues/75031 there is an other option to fix this by modifying the GOTOOLCHAIN variable, but that is too much magic for me and could be very hard to debug for the next person who stumbles over this. --- internal/bitbucket/bitbucket_test.go | 9 +++++++++ internal/logger/logger_test.go | 9 +++++++++ internal/output/output_test.go | 9 +++++++++ internal/sonar/sonar_test.go | 9 +++++++++ internal/testHelpers/testHelpers_test.go | 9 +++++++++ 5 files changed, 45 insertions(+) create mode 100644 internal/bitbucket/bitbucket_test.go create mode 100644 internal/logger/logger_test.go create mode 100644 internal/output/output_test.go create mode 100644 internal/sonar/sonar_test.go create mode 100644 internal/testHelpers/testHelpers_test.go diff --git a/internal/bitbucket/bitbucket_test.go b/internal/bitbucket/bitbucket_test.go new file mode 100644 index 000000000..688234d4d --- /dev/null +++ b/internal/bitbucket/bitbucket_test.go @@ -0,0 +1,9 @@ +package bitbucket_test + +import "testing" + +func TestPlaceholder(t *testing.T) { + // We use the tool cover for coverage, but if there is no _test.go file, then + // Go use the tool covdata. At the same time, they removed covdata as a precompiled + // binary in the distribution. This made the coverage calculation fail for some of us. +} diff --git a/internal/logger/logger_test.go b/internal/logger/logger_test.go new file mode 100644 index 000000000..10f1e513b --- /dev/null +++ b/internal/logger/logger_test.go @@ -0,0 +1,9 @@ +package logger_test + +import "testing" + +func TestPlaceholder(t *testing.T) { + // We use the tool cover for coverage, but if there is no _test.go file, then + // Go use the tool covdata. At the same time, they removed covdata as a precompiled + // binary in the distribution. This made the coverage calculation fail for some of us. +} diff --git a/internal/output/output_test.go b/internal/output/output_test.go new file mode 100644 index 000000000..f65121d58 --- /dev/null +++ b/internal/output/output_test.go @@ -0,0 +1,9 @@ +package output_test + +import "testing" + +func TestPlaceholder(t *testing.T) { + // We use the tool cover for coverage, but if there is no _test.go file, then + // Go use the tool covdata. At the same time, they removed covdata as a precompiled + // binary in the distribution. This made the coverage calculation fail for some of us. +} diff --git a/internal/sonar/sonar_test.go b/internal/sonar/sonar_test.go new file mode 100644 index 000000000..62ff64548 --- /dev/null +++ b/internal/sonar/sonar_test.go @@ -0,0 +1,9 @@ +package sonar_test + +import "testing" + +func TestPlaceholder(t *testing.T) { + // We use the tool cover for coverage, but if there is no _test.go file, then + // Go use the tool covdata. At the same time, they removed covdata as a precompiled + // binary in the distribution. This made the coverage calculation fail for some of us. +} diff --git a/internal/testHelpers/testHelpers_test.go b/internal/testHelpers/testHelpers_test.go new file mode 100644 index 000000000..03b6c9de1 --- /dev/null +++ b/internal/testHelpers/testHelpers_test.go @@ -0,0 +1,9 @@ +package testHelpers_test + +import "testing" + +func TestPlaceholder(t *testing.T) { + // We use the tool cover for coverage, but if there is no _test.go file, then + // Go use the tool covdata. At the same time, they removed covdata as a precompiled + // binary in the distribution. This made the coverage calculation fail for some of us. +}