Skip to content

Commit

Permalink
fix(integration_runner): Fixes test failures
Browse files Browse the repository at this point in the history
If EXPECT_PHP_PACKAGES was not given and the agent detected a
package then the test would fail which is not the desired behavior.
  • Loading branch information
mfulb committed Dec 5, 2023
1 parent 4fdd46e commit aa61bb6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/newrelic/integration/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ func (t *Test) comparePhpPackages(harvest *newrelic.Harvest) {
t.Fatal(fmt.Errorf("EXPECTED_PHP_PACKAGES used but no packaged detected in environment!"))
}
} else {
expectedPackages = nil
// no configuration given for package (no EXPECT_PHP_PACKAGES in test case) so don't run test
return
}

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

fmt.Printf("harvest.PhpPackages %+v\n", harvest.PhpPackages)
fmt.Printf("actualPackages %+v\n", actualPackages)
fmt.Printf("expectedPackages %+v\n", expectedPackages)

if nil != harvest.PhpPackages && 0 < harvest.PhpPackages.NumSaved() {
if nil == expectedPackages {
t.Fail(fmt.Errorf("No expected PHP packages, harvest contains %+v\n", actualPackages))
Expand Down

0 comments on commit aa61bb6

Please sign in to comment.