-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
100 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
parameters: | ||
PackagePath: "sdk/monitor/opentelemetry-exporter/" | ||
|
||
steps: | ||
- bash: | | ||
node ../../../common/scripts/install-run-rushx.js test-opentelemetry-versions --verbose | ||
condition: succeededOrFailed() | ||
displayName: "Test OpenTelemetry Versions - Monitor" | ||
workingDirectory: "${{parameters.PackagePath}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# DO NOT EDIT THIS FILE | ||
# This file is generated automatically and any changes will be lost. | ||
|
||
trigger: | ||
branches: | ||
include: | ||
- master | ||
- release/* | ||
- hotfix/* | ||
paths: | ||
include: | ||
- sdk/monitor/ | ||
|
||
pr: | ||
branches: | ||
include: | ||
- master | ||
- feature/* | ||
- release/* | ||
- hotfix/* | ||
paths: | ||
include: | ||
- sdk/monitor/ | ||
|
||
extends: | ||
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml | ||
parameters: | ||
ServiceDirectory: monitor | ||
RunUnitTests: true | ||
Artifacts: | ||
- name: azure-monitor-opentelemety-exporter | ||
safeName: azuremonitoropentelemetryexporter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
sdk/monitor/opentelemetry-exporter/test-opentelemetry-versions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const execa = require("execa"); | ||
|
||
const versions = ["latest", "canary"]; | ||
|
||
const packageJson = require("./package.json"); | ||
const packages = [ | ||
...Object.keys(packageJson.dependencies).filter((package) => | ||
package.startsWith("@opentelemetry") | ||
), | ||
...Object.keys(packageJson.devDependencies).filter((package) => | ||
package.startsWith("@opentelemetry") | ||
) | ||
]; | ||
|
||
async function exec(cmd) { | ||
const command = execa(cmd, { cwd: ".", shell: true }); | ||
command.stderr.pipe(process.stderr); | ||
command.stdout.pipe(process.stdout); | ||
return command; | ||
} | ||
|
||
(async () => { | ||
try { | ||
console.log("Running opentelemetry version test against", versions); | ||
for (const version of versions) { | ||
// Note: this moves devDeps to dependencies, but it does not matter for these tests | ||
const packagesToInstall = packages.map((package) => `${package}@${version}`).join(" "); | ||
console.log(`Installing ${packagesToInstall}`); | ||
await exec(`npm install --no-save ${packagesToInstall}`); | ||
|
||
console.log(`Compiling on version: ${version}`); | ||
await exec(`npm run build`); | ||
|
||
console.log(`Running tests on version: ${version}`); | ||
await exec(`npm run test`); | ||
} | ||
process.exit(0); | ||
} catch (error) { | ||
console.log("Opentelemetry version test failed!"); | ||
console.log(error); | ||
process.exit(1); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
trigger: none | ||
|
||
extends: | ||
template: ../../../eng/pipelines/templates/jobs/archetype-sdk-integration.yml | ||
parameters: | ||
TimeoutInMinutes: 15 | ||
PackageName: "@azure/monitor-opentelemetry-exporter" | ||
ResourceServiceDirectory: monitor | ||
TestSamples: false | ||
PostIntegrationSteps: monitor-additional-steps |