ubuntu / ubuntu-report

Report hardware and other collected metrics like installer or upgrade information
GNU General Public License v3.0
68 stars 29 forks source link

fix(pkg): append case to test files to avoid collisions #62

Closed matthew-hagemann closed 7 months ago

matthew-hagemann commented 7 months ago

I ran into case-insensitive goldenfile name collisions when importing pkg in another project:

go: github.com/canonical/ubuntu-desktop-provision/provd/internal/services/telemetry imports
    github.com/ubuntu/ubuntu-report/pkg/sysmetrics: create zip: pkg/sysmetrics/testdata/good/gold/cachereport-twice.ReportType0-no: case-insensitive file name collision: "pkg/sysmetrics/testdata/good/gold/cachereport-twice.ReportType0-NO" and "pkg/sysmetrics/testdata/good/gold/cachereport-twice.ReportType0-no"
pkg/sysmetrics/testdata/good/gold/cachereport-twice.ReportType0-y: case-insensitive file name collision: "pkg/sysmetrics/testdata/good/gold/cachereport-twice.ReportType0-Y" and "pkg/sysmetrics/testdata/good/gold/cachereport-twice.ReportType0-y"
pkg/sysmetrics/testdata/good/gold/cachereport-twice.ReportType0-yes: case-insensitive file name collision: "pkg/sysmetrics/testdata/good/gold/cachereport-twice.ReportType0-YES" and "pkg/sysmetrics/testdata/good/gold/cachereport-twice.ReportType0-yes"

This PR aims to solve these by having the goldenfiles for these testcases save with -lc and -uc appended to the end of the file name to differentiate goldenfiles in case insensitive environments