mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 07:56:36 +01:00
chore: update failing tests
Signed-off-by: Keith Zantow <keith.zantow@anchore.com>
This commit is contained in:
@@ -731,7 +731,9 @@ func heldFiles(tempDir string) (names []string) {
|
|||||||
func isolatedTempDir(t *testing.T) string {
|
func isolatedTempDir(t *testing.T) string {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
dir := t.TempDir()
|
dir := t.TempDir()
|
||||||
t.Setenv("TMPDIR", dir)
|
t.Setenv("TMPDIR", dir) // unix
|
||||||
|
t.Setenv("TMP", dir) // windows
|
||||||
|
t.Setenv("TEMP", dir) // windows fallback
|
||||||
require.Equal(t, dir, os.TempDir(), "extraction must be writing where the probe is looking")
|
require.Equal(t, dir, os.TempDir(), "extraction must be writing where the probe is looking")
|
||||||
return dir
|
return dir
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ func TestArchiveCataloger(t *testing.T) {
|
|||||||
resolvedScanDir, err := filepath.EvalSymlinks(scanDir)
|
resolvedScanDir, err := filepath.EvalSymlinks(scanDir)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
resolvedScanDir = filepath.ToSlash(resolvedScanDir)
|
||||||
|
|
||||||
recorder := &recordingBus{}
|
recorder := &recordingBus{}
|
||||||
bus.Set(recorder)
|
bus.Set(recorder)
|
||||||
t.Cleanup(func() { bus.Set(nil) })
|
t.Cleanup(func() { bus.Set(nil) })
|
||||||
|
|||||||
Reference in New Issue
Block a user