Skip to content

Commit 593fc57

Browse files
authored
[@azure/confidential-ledger-rest] Migrate to latest test recorder and externalize recordings (Azure#26305)
### Packages impacted by this PR `@azure-rest/confidential-ledger` `@azure-tools/test-recorder` ### Issues associated with this PR Fixes Azure#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.
1 parent 9a2fd32 commit 593fc57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+456
-38226
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"AssetsRepo": "Azure/azure-sdk-assets",
3+
"AssetsRepoPrefixPath": "js",
4+
"TagPrefix": "js/confidentialledger/confidential-ledger-rest",
5+
"Tag": "js/confidentialledger/confidential-ledger-rest_73e943cd0e"
6+
}

sdk/confidentialledger/confidential-ledger-rest/karma.conf.js

Lines changed: 0 additions & 145 deletions
This file was deleted.

sdk/confidentialledger/confidential-ledger-rest/package.json

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -50,36 +50,32 @@
5050
"disableDocsMs": true,
5151
"apiRefLink": "https://docs.microsoft.com/azure/confidential-ledger"
5252
},
53-
"browser": {
54-
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js",
55-
"./dist-esm/src/certificatePolicy.js": "./dist-esm/src/certificatePolicy.browser.js"
56-
},
5753
"scripts": {
5854
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
59-
"build:browser": "tsc -p . && dev-tool run bundle",
60-
"build:node": "tsc -p . && dev-tool run bundle",
55+
"build:browser": "echo \"Browser is not supported.\" && exit 0",
56+
"build:node": "tsc -p . && dev-tool run bundle --browser-test=false",
6157
"build:samples": "echo Obsolete.",
62-
"build:test": "tsc -p . && dev-tool run bundle",
63-
"build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local",
58+
"build:test": "tsc -p . && dev-tool run bundle --browser-test=false",
59+
"build": "npm run clean && tsc -p . && dev-tool run bundle --browser-test=false && api-extractor run --local",
6460
"build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
6561
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
66-
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
62+
"clean": "rimraf dist dist-browser dist-esm dist-test temp types *.tgz *.log",
6763
"execute:samples": "dev-tool samples run samples-dev",
6864
"extract-api": "tsc -p . && api-extractor run --local",
6965
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
7066
"generate:client": "autorest --typescript swagger/README.md && rushx format",
71-
"integration-test:browser": "echo skip",
72-
"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\"",
73-
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
67+
"integration-test:browser": "echo \"Browser is not supported.\" && exit 0",
68+
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
69+
"integration-test": "npm run integration-test:node",
7470
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
7571
"lint": "eslint package.json api-extractor.json src test --ext .ts",
7672
"pack": "npm pack 2>&1",
7773
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
7874
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
7975
"test": "npm run clean && npm run build:test && npm run unit-test",
80-
"unit-test:browser": "echo skip",
81-
"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\"",
82-
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
76+
"unit-test:browser": "echo \"Browser is not supported.\" && exit 0",
77+
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/**/*.spec.ts'",
78+
"unit-test": "npm run unit-test:node"
8379
},
8480
"sideEffects": false,
8581
"autoPublish": false,
@@ -89,11 +85,11 @@
8985
"@azure/core-paging": "^1.3.0",
9086
"@azure/core-rest-pipeline": "^1.1.0",
9187
"@azure/logger": "^1.0.0",
92-
"autorest": "^3.6.1",
9388
"tslib": "^2.2.0"
9489
},
9590
"devDependencies": {
96-
"@azure-tools/test-recorder": "^1.0.0",
91+
"@azure-tools/test-recorder": "^3.0.1",
92+
"@azure-tools/test-credential": "^1.0.0",
9793
"@azure/dev-tool": "^1.0.0",
9894
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
9995
"@azure/identity": "^2.0.1",
@@ -106,18 +102,6 @@
106102
"cross-env": "^7.0.2",
107103
"dotenv": "^16.0.0",
108104
"eslint": "^8.0.0",
109-
"karma": "^6.2.0",
110-
"karma-chrome-launcher": "^3.0.0",
111-
"karma-coverage": "^2.0.0",
112-
"karma-env-preprocessor": "^0.1.1",
113-
"karma-firefox-launcher": "^1.1.0",
114-
"karma-json-preprocessor": "^0.3.3",
115-
"karma-json-to-file-reporter": "^1.0.1",
116-
"karma-junit-reporter": "^2.0.1",
117-
"karma-mocha": "^2.0.1",
118-
"karma-mocha-reporter": "^2.2.5",
119-
"karma-source-map-support": "~1.4.0",
120-
"karma-sourcemap-loader": "^0.3.8",
121105
"mocha": "^7.1.1",
122106
"mocha-junit-reporter": "^2.0.0",
123107
"nyc": "^15.0.0",

sdk/confidentialledger/confidential-ledger-rest/recordings/node/colder_endpoints/recording_should_obtain_constitution_from_ledger.js

Lines changed: 0 additions & 156 deletions
This file was deleted.

sdk/confidentialledger/confidential-ledger-rest/recordings/node/colder_endpoints/recording_should_retrieve_a_list_of_consortium_members.js

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)