Skip to content

Commit c40a505

Browse files
committed
Add integration check for Deno
1 parent a32817a commit c40a505

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,24 @@ jobs:
5858
run: |
5959
npm run check-integration
6060
61+
test-deno-integration:
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- name: Install Deno
67+
uses: denoland/setup-deno@v2
68+
with:
69+
deno-version: '~2.0'
70+
- name: Check Integration
71+
env:
72+
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
73+
DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY }}
74+
DATADOG_SITE: ${{ secrets.DATADOG_API_HOST }}
75+
run: |
76+
cd test-other
77+
deno --allow-all integration_check_deno.ts
78+
6179
lint:
6280
runs-on: ubuntu-latest
6381
steps:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "datadog-metrics",
33
"version": "0.13.0-dev",
44
"description": "Buffered metrics reporting via the Datadog HTTP API",
5+
"type": "commonjs",
56
"main": "index.js",
67
"types": "dist/index.d.ts",
78
"repository": {

test-other/integration_check_deno.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { main } from './integration_check_lib.mjs';
88

9-
main({ variant: 'deno' }).catch(error => {
9+
main({ tagSuffix: '-deno' }).catch(error => {
1010
process.exitCode = 1;
1111
console.error(error);
1212
});

test-other/integration_check_lib.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ const testMetrics = [
4444
},
4545
];
4646

47-
export async function main() {
47+
export async function main({ tagSuffix = '' } = {}) {
48+
if (tagSuffix) {
49+
for (const metric of testMetrics) {
50+
metric.tags = metric.tags.map(tag => `${tag}${tagSuffix}`);
51+
}
52+
}
53+
4854
datadogMetrics.init({ flushIntervalSeconds: 0 });
4955

5056
for (const metric of testMetrics) {

0 commit comments

Comments
 (0)