Skip to content

Commit

Permalink
[@azure/confidential-ledger-rest] Migrate to latest test recorder and…
Browse files Browse the repository at this point in the history
… externalize recordings (#26305)

### Packages impacted by this PR

`@azure-rest/confidential-ledger`
`@azure-tools/test-recorder`

### Issues associated with this PR

Fixes #20495

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

Migrate to the latest test recorder in order to use the test proxy and
externalize recordings. I also had to regenerate the RLC in order to fix
an issue with `isUnexpected` not working properly for the user endpoint.

Getting the test resources to deploy correctly also took some doing
since it uses the `oid` and not the normal client id of the test app.

The tests themselves were a bit busted in places; I shored them up as
best I could given the odd behavior of the service.

Lastly, the test recorder didn't have support for any custom transport
options, so I had to add one in order to pass the `TLSValidationCert` in
order for it to work properly with confidential ledger.
  • Loading branch information
xirzec authored Jun 23, 2023
1 parent 9a2fd32 commit 593fc57
Show file tree
Hide file tree
Showing 42 changed files with 456 additions and 38,226 deletions.
6 changes: 6 additions & 0 deletions sdk/confidentialledger/confidential-ledger-rest/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/confidentialledger/confidential-ledger-rest",
"Tag": "js/confidentialledger/confidential-ledger-rest_73e943cd0e"
}
145 changes: 0 additions & 145 deletions sdk/confidentialledger/confidential-ledger-rest/karma.conf.js

This file was deleted.

42 changes: 13 additions & 29 deletions sdk/confidentialledger/confidential-ledger-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,36 +50,32 @@
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/azure/confidential-ledger"
},
"browser": {
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js",
"./dist-esm/src/certificatePolicy.js": "./dist-esm/src/certificatePolicy.browser.js"
},
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build:browser": "tsc -p . && dev-tool run bundle",
"build:node": "tsc -p . && dev-tool run bundle",
"build:browser": "echo \"Browser is not supported.\" && exit 0",
"build:node": "tsc -p . && dev-tool run bundle --browser-test=false",
"build:samples": "echo Obsolete.",
"build:test": "tsc -p . && dev-tool run bundle",
"build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local",
"build:test": "tsc -p . && dev-tool run bundle --browser-test=false",
"build": "npm run clean && tsc -p . && dev-tool run bundle --browser-test=false && api-extractor run --local",
"build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"clean": "rimraf dist dist-browser dist-esm dist-test temp types *.tgz *.log",
"execute:samples": "dev-tool samples run samples-dev",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"generate:client": "autorest --typescript swagger/README.md && rushx format",
"integration-test:browser": "echo skip",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}*.spec.js\"",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo \"Browser is not supported.\" && exit 0",
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
"integration-test": "npm run integration-test:node",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts",
"pack": "npm pack 2>&1",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
"test": "npm run clean && npm run build:test && npm run unit-test",
"unit-test:browser": "echo skip",
"unit-test:node": "mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}*.spec.ts\"",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
"unit-test:browser": "echo \"Browser is not supported.\" && exit 0",
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/**/*.spec.ts'",
"unit-test": "npm run unit-test:node"
},
"sideEffects": false,
"autoPublish": false,
Expand All @@ -89,11 +85,11 @@
"@azure/core-paging": "^1.3.0",
"@azure/core-rest-pipeline": "^1.1.0",
"@azure/logger": "^1.0.0",
"autorest": "^3.6.1",
"tslib": "^2.2.0"
},
"devDependencies": {
"@azure-tools/test-recorder": "^1.0.0",
"@azure-tools/test-recorder": "^3.0.1",
"@azure-tools/test-credential": "^1.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^2.0.1",
Expand All @@ -106,18 +102,6 @@
"cross-env": "^7.0.2",
"dotenv": "^16.0.0",
"eslint": "^8.0.0",
"karma": "^6.2.0",
"karma-chrome-launcher": "^3.0.0",
"karma-coverage": "^2.0.0",
"karma-env-preprocessor": "^0.1.1",
"karma-firefox-launcher": "^1.1.0",
"karma-json-preprocessor": "^0.3.3",
"karma-json-to-file-reporter": "^1.0.1",
"karma-junit-reporter": "^2.0.1",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-source-map-support": "~1.4.0",
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^7.1.1",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 593fc57

Please sign in to comment.