Skip to content

Commit

Permalink
[perf] Migrate @azure-tests/perf-monitor-opentelemtry to ESM (#32254)
Browse files Browse the repository at this point in the history
### Packages impacted by this PR

- @azure-tests/perf-monitor-opentelemtry

### Issues associated with this PR

- #31338

### Describe the problem that is addressed by this PR

Migrates @azure-tests/perf-monitor-opentelemtry to ESM via automation.

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
  • Loading branch information
mpodwysocki authored Dec 17, 2024
1 parent 1700ea5 commit b042366
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 19 deletions.
53 changes: 42 additions & 11 deletions sdk/monitor/perf-tests/monitor-opentelemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
"sdk-type": "perf-test",
"version": "1.0.0",
"description": "",
"main": "",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
"type": "module",
"keywords": [],
"author": "",
"license": "ISC",
"author": "Microsoft Corporation",
"license": "MIT",
"dependencies": {
"@azure-tools/test-perf": "^1.0.0",
"@azure/monitor-opentelemetry": "^1.8.0",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/api-logs": "^0.56.0",
"@opentelemetry/sdk-logs": "^0.56.0",
"dotenv": "^16.0.0",
"tslib": "^2.6.2"
"tslib": "^2.8.1"
},
"devDependencies": {
"@azure/dev-tool": "^1.0.0",
Expand All @@ -25,25 +26,55 @@
},
"private": true,
"scripts": {
"build": "npm run clean && tsc -p .",
"build": "npm run clean && dev-tool run build-package",
"build:samples": "echo skipped",
"build:test": "echo skipped",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"test/**/*.ts\" \"*.{js,json}\"",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"",
"clean": "dev-tool run vendored rimraf --glob dist dist-* types *.tgz *.log",
"format": "dev-tool run vendored prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"test/**/*.ts\" \"*.{js,json}\"",
"format": "dev-tool run vendored prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"",
"integration-test": "echo skipped",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"lint": "eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs test",
"lint:fix": "eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs test --fix --fix-type [problem,suggestion]",
"lint": "dev-tool run vendored eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs src",
"lint:fix": "dev-tool run vendored eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs src --fix --fix-type [problem,suggestion]",
"pack": "npm pack 2>&1",
"perf-test:node": "npm run build && node dist-esm/index.spec.js",
"perf-test:node": "npm run build && node dist/esm/index.js",
"test": "echo skipped",
"test:browser": "echo skipped",
"test:node": "echo skipped",
"unit-test": "echo skipped",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"update-snippets": "echo skipped"
}
},
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"selfLink": false
},
"files": [
"dist/",
"README.md",
"LICENSE"
],
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"types": "./dist/commonjs/index.d.ts"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

import { PerfTest } from "@azure-tools/test-perf";
import { useAzureMonitor, AzureMonitorOpenTelemetryOptions } from "@azure/monitor-opentelemetry";

import * as dotenv from "dotenv";
dotenv.config();
import "dotenv/config";

export abstract class MonitorOpenTelemetryTest<TOptions> extends PerfTest<TOptions> {
constructor() {
Expand Down
17 changes: 12 additions & 5 deletions sdk/monitor/perf-tests/monitor-opentelemetry/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"outDir": "./dist-esm",
"declarationDir": "./types",
"paths": {
"@azure/monitor-opentelemetry-exporter": ["./src/index"]
}
"@azure-tests/perf-monitor-opentelemetry": ["./src/index"]
},
"rootDir": "."
},
"include": ["src/**/*.ts", "test/**/*.ts", "samples-dev/**/*.ts"]
"include": [
"src/**/*.ts",
"src/**/*.mts",
"src/**/*.cts",
"samples-dev/**/*.ts",
"src/**/*.ts",
"src/**/*.mts",
"src/**/*.cts"
]
}

0 comments on commit b042366

Please sign in to comment.