Skip to content

Commit

Permalink
chore: Updated agent integration tests to node:test
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Nov 22, 2024
1 parent bd9df5f commit 04f366c
Show file tree
Hide file tree
Showing 12 changed files with 541 additions and 505 deletions.
9 changes: 4 additions & 5 deletions .borp.int.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
files:
- 'test/integration/**/*.tap.js'
# We can't do a simple '**/*.test.js' because the "uninstrumented" suite
# includes a `node_modules` directory that includes several `.test.js` files.
- 'test/integration/*.test.js'
- 'test/integration/cat/*.test.js'
- 'test/integration/config/*.test.js'
- 'test/integration/**/*.test.js'
# We need to ignore any `*.test.js` files within nested `node_modules`
# directories. We only want to target the tests we have written ourselves.
- '!test/integration/**/node_modules/**/*'
12 changes: 6 additions & 6 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ This product includes source derived from [@grpc/proto-loader](https://github.co

### @newrelic/security-agent

This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v2.0.0](https://github.com/newrelic/csec-node-agent/tree/v2.0.0)), distributed under the [UNKNOWN License](https://github.com/newrelic/csec-node-agent/blob/v2.0.0/LICENSE):
This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v2.1.1](https://github.com/newrelic/csec-node-agent/tree/v2.1.1)), distributed under the [UNKNOWN License](https://github.com/newrelic/csec-node-agent/blob/v2.1.1/LICENSE):

```
## New Relic Software License v1.0
Expand Down Expand Up @@ -1042,7 +1042,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

### winston-transport

This product includes source derived from [winston-transport](https://github.com/winstonjs/winston-transport) ([v4.8.0](https://github.com/winstonjs/winston-transport/tree/v4.8.0)), distributed under the [MIT License](https://github.com/winstonjs/winston-transport/blob/v4.8.0/LICENSE):
This product includes source derived from [winston-transport](https://github.com/winstonjs/winston-transport) ([v4.9.0](https://github.com/winstonjs/winston-transport/tree/v4.9.0)), distributed under the [MIT License](https://github.com/winstonjs/winston-transport/blob/v4.9.0/LICENSE):

```
The MIT License (MIT)
Expand Down Expand Up @@ -1075,7 +1075,7 @@ SOFTWARE.

### @aws-sdk/client-s3

This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.676.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.676.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.676.0/LICENSE):
This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.698.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.698.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.698.0/LICENSE):

```
Apache License
Expand Down Expand Up @@ -1284,7 +1284,7 @@ This product includes source derived from [@aws-sdk/client-s3](https://github.co

### @aws-sdk/s3-request-presigner

This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.676.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.676.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.676.0/LICENSE):
This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.698.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.698.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.698.0/LICENSE):

```
Apache License
Expand Down Expand Up @@ -2711,7 +2711,7 @@ THE SOFTWARE.

### aws-sdk

This product includes source derived from [aws-sdk](https://github.com/aws/aws-sdk-js) ([v2.1691.0](https://github.com/aws/aws-sdk-js/tree/v2.1691.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js/blob/v2.1691.0/LICENSE.txt):
This product includes source derived from [aws-sdk](https://github.com/aws/aws-sdk-js) ([v2.1692.0](https://github.com/aws/aws-sdk-js/tree/v2.1692.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js/blob/v2.1692.0/LICENSE.txt):

```
Expand Down Expand Up @@ -2921,7 +2921,7 @@ This product includes source derived from [aws-sdk](https://github.com/aws/aws-s

### borp

This product includes source derived from [borp](https://github.com/mcollina/borp) ([v0.18.0](https://github.com/mcollina/borp/tree/v0.18.0)), distributed under the [MIT License](https://github.com/mcollina/borp/blob/v0.18.0/LICENSE):
This product includes source derived from [borp](https://github.com/mcollina/borp) ([v0.19.0](https://github.com/mcollina/borp/tree/v0.19.0)), distributed under the [MIT License](https://github.com/mcollina/borp/blob/v0.19.0/LICENSE):

```
MIT License
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
"ajv": "^6.12.6",
"async": "^3.2.4",
"aws-sdk": "^2.1604.0",
"borp": "^0.18.0",
"borp": "^0.19.0",
"c8": "^8.0.1",
"clean-jsdoc-theme": "^4.2.18",
"commander": "^7.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

'use strict'

const test = require('tap').test
const test = require('node:test')
const assert = require('node:assert')

const metricPrefix = require('../../../lib/metrics/names').SUPPORTABILITY.PREFIX

test('Multiple require("newrelic")', function (t) {
test('Multiple require("newrelic")', () => {
process.env.NEW_RELIC_ENABLED = true
process.env.NEW_RELIC_APP_NAME = 'agent test'

Expand All @@ -19,8 +21,7 @@ test('Multiple require("newrelic")', function (t) {

const second = require(path)

t.equal(first, second)
assert.equal(first, second)
const doubleLoadMetric = second.agent.metrics.getOrCreateMetric(`${metricPrefix}Agent/DoubleLoad`)
t.equal(doubleLoadMetric.callCount, 1, 'should have tried to double-load the agent once')
t.end()
assert.equal(doubleLoadMetric.callCount, 1, 'should have tried to double-load the agent once')
})
Loading

0 comments on commit 04f366c

Please sign in to comment.