Skip to content

Commit

Permalink
Switch plugin test to always fail
Browse files Browse the repository at this point in the history
By converting the plugin test to something that always fails, we're not
dependent on the health of the OSDF infrastructure (or the location of a
specific file that might be removed in the future).
  • Loading branch information
bbockelm committed Jan 5, 2024
1 parent 491db8c commit 6fd9403
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestStashPluginMain(t *testing.T) {
// Parts of test adapted from: https://stackoverflow.com/questions/26225513/how-to-test-os-exit-scenarios-in-go
if os.Getenv("RUN_STASHPLUGIN") == "1" {
// Download a test file
args := []string{"osdf:///osgconnect/public/osg/testfile.txt", tempDir}
args := []string{"pelican://pelican.example.com/osgconnect/public/osg/testfile.txt", tempDir}
stashPluginMain(args)
os.Unsetenv("STASH_LOGGING_LEVEL")
os.Unsetenv("RUN_STASHPLUGIN")
Expand All @@ -84,11 +84,11 @@ func TestStashPluginMain(t *testing.T) {
cmd.Stderr = &stderr

err := cmd.Run()
assert.NoError(t, err, stderr.String())
assert.Error(t, err, stderr.String())

// changing output for "\\" since in windows there are excess "\" printed in debug logs
output := strings.Replace(stderr.String(), "\\\\", "\\", -1)

expectedOutput := "Downloading: osdf:///osgconnect/public/osg/testfile.txt to " + tempDir
expectedOutput := "Downloading: pelican://pelican.example.com/osgconnect/public/osg/testfile.txt to " + tempDir
assert.Contains(t, output, expectedOutput)
}

0 comments on commit 6fd9403

Please sign in to comment.