Skip to content

Commit aa61bb6

Browse files
committed
fix(integration_runner): Fixes test failures
If EXPECT_PHP_PACKAGES was not given and the agent detected a package then the test would fail which is not the desired behavior.
1 parent 4fdd46e commit aa61bb6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/newrelic/integration/test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ func (t *Test) comparePhpPackages(harvest *newrelic.Harvest) {
516516
t.Fatal(fmt.Errorf("EXPECTED_PHP_PACKAGES used but no packaged detected in environment!"))
517517
}
518518
} else {
519-
expectedPackages = nil
519+
// no configuration given for package (no EXPECT_PHP_PACKAGES in test case) so don't run test
520+
return
520521
}
521522

522523
audit, err := newrelic.IntegrationData(harvest.PhpPackages, newrelic.AgentRunID("?? agent run id"), time.Now())
@@ -530,10 +531,6 @@ func (t *Test) comparePhpPackages(harvest *newrelic.Harvest) {
530531
return
531532
}
532533

533-
fmt.Printf("harvest.PhpPackages %+v\n", harvest.PhpPackages)
534-
fmt.Printf("actualPackages %+v\n", actualPackages)
535-
fmt.Printf("expectedPackages %+v\n", expectedPackages)
536-
537534
if nil != harvest.PhpPackages && 0 < harvest.PhpPackages.NumSaved() {
538535
if nil == expectedPackages {
539536
t.Fail(fmt.Errorf("No expected PHP packages, harvest contains %+v\n", actualPackages))

0 commit comments

Comments
 (0)