Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
798e4f2
Rename to use sbClient for instances of ServiceBusClient
ramya0820 May 16, 2019
5a27e6d
Refactor out loading of environment variables
ramya0820 May 20, 2019
741e15d
Merge branch 'master' into issue-2859
ramya0820 May 20, 2019
d217886
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-js in…
ramya0820 May 20, 2019
71eb034
Simplify if-else checks
ramya0820 May 20, 2019
360f24a
Merge branch 'issue-2859' of https://github.com/ramya0820/azure-sdk-f…
ramya0820 May 20, 2019
dd56447
Rename utility function to getNamespace
ramya0820 May 20, 2019
96b0b83
Simplify env variable access and error handling
ramya0820 May 20, 2019
3dc2806
Merge branch 'master' into issue-2859
ramya0820 May 20, 2019
1bd14a6
Merge branch 'master' into issue-2859
ramya0820 May 21, 2019
69e3928
Address comments
ramya0820 May 21, 2019
27899e9
Merge branch 'issue-2859' of https://github.com/ramya0820/azure-sdk-f…
ramya0820 May 21, 2019
5f00bdd
Refactor all tests
ramya0820 May 21, 2019
3a1c9e0
Address comments
ramya0820 May 21, 2019
290511b
Merge branch 'master' into issue-2859
ramya0820 May 21, 2019
0d8701d
nom -> npm
ramya0820 May 21, 2019
173d399
Merge fix from issue-2861 and update isNode references
ramya0820 May 21, 2019
b2e36a0
Revert isNode import from amqp-common
ramya0820 May 21, 2019
536d527
Update isNode computation
ramya0820 May 22, 2019
a256dfc
Update isNode check in utils and add header
ramya0820 May 22, 2019
2d465a0
Update reference to version usage in browser mode
ramya0820 May 22, 2019
34ae808
Update version usage references
ramya0820 May 22, 2019
6711f91
Make dependency exclusion test specific
ramya0820 May 22, 2019
09c7cb2
Refactor rollup test config
ramya0820 May 22, 2019
11abcf8
Revert changes that fix version not defined on CI
ramya0820 May 22, 2019
1eb1857
Minor edit to get around linter
ramya0820 May 22, 2019
a234736
Cleanup external module reference
ramya0820 May 22, 2019
ec96ec0
Make ms-rest-nodeauth external for browser
ramya0820 May 22, 2019
789357d
Bypass rush
ramya0820 May 22, 2019
7e49a35
Bypass rush
ramya0820 May 22, 2019
2abfef3
Revert bypassing rush
ramya0820 May 22, 2019
f4adf22
Merge branch 'master' into issue-2859
ramya0820 May 23, 2019
cfe3249
Add missing browser dependencies
May 23, 2019
471919b
Dedupe test:browser script content
May 23, 2019
2906726
Run only a single live test at a time
May 23, 2019
e324063
Merge branch 'master' into issue-2859
ramya0820 May 28, 2019
d3b8846
Use package.json approach
ramya0820 May 29, 2019
bb33fe6
Merge branch 'issue-2859' of https://github.com/ramya0820/azure-sdk-f…
ramya0820 May 29, 2019
6c5c53c
Skip browser tests on CI
ramya0820 May 29, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 26 additions & 80 deletions .azure-pipelines/client.test.live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,40 @@
# The package to build and test. Defined in pipeline web ui because multiple pipelines use this YAML with different packages.
# Example: @azure/event-hubs

variables:
NodeVersion: '10.x'

jobs:
- job: 'Test_Node'
- job: 'LiveTest'
strategy:
# Service Bus and Event Hubs currently lack support for running multiple test suites in parallel,
# Live tests currently lack support for running multiple test suites in parallel,
# since the tests would attempt to use the same resources which causes conflicts.
maxParallel: 1
matrix:
Linux_Node10X:
Linux_Node10:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
NodeVersion: '10.x'
Windows_Node10X:
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
NodeVersion: '10.x'
Mac_Node10X:
OSName: 'Mac'
OSVmImage: 'macOS-10.13'
NodeVersion: '10.x'

pool:
vmImage: '$(OSVmImage)'

timeoutInMinutes: 240

steps:
- task: NodeTool@0
inputs:
versionSpec: '$(NodeVersion)'
displayName: 'Install Node.js $(NodeVersion)'

- script: |
node common/scripts/install-run-rush.js install
displayName: 'Install dependencies'

- script: |
node common/scripts/install-run-rush.js build -t "$(Package)" --verbose
displayName: 'rush build -t "$(Package)"'

- script: |
node common/scripts/install-run-rush.js build:test -t "$(Package)" --verbose
displayName: 'rush build:test -t "$(Package)"'

- script: |
node common/scripts/install-run-rush.js integration-test:node -t "$(Package)" --verbose
displayName: 'rush integration-test:node -t "$(Package)"'
env:
# Service Bus
AAD_CLIENT_ID: $(aad-azure-sdk-test-client-id)
AAD_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
AAD_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
AZURE_SUBSCRIPTION_ID: $(test-subscription-id)
CLEAN_NAMESPACE: 'true'
RESOURCE_GROUP: $(service-bus-test-resource-group)
SERVICEBUS_CONNECTION_STRING: $(service-bus-test-connection-string)
# Event Hubs
EVENTHUB_CONNECTION_STRING: $(js-event-hubs-test-connection-string)
EVENTHUB_NAME: $(js-event-hubs-test-name)
IOTHUB_CONNECTION_STRING: $(js-event-hubs-test-iothub-connection-string)
STORAGE_CONNECTION_STRING: $(js-event-hubs-test-storage-connection-string)

- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: '$(OSName) Node $(NodeVersion) - Node'
condition: succeededOrFailed()
displayName: 'Publish node test results'

- job: 'Test_Browser'
strategy:
# Service Bus and Event Hubs currently lack support for running multiple test suites in parallel,
# since the tests would attempt to use the same resources which causes conflicts.
maxParallel: 1
matrix:
Linux_Node10X:
TestTarget: 'node'
Linux_Browser:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
NodeVersion: '10.x'
Windows_Node10X:
TestTarget: 'browser'
Windows_Node10:
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
TestTarget: 'node'
Windows_Browser:
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
NodeVersion: '10.x'
Mac_Node10X:
TestTarget: 'browser'
Mac_Node10:
OSName: 'Mac'
OSVmImage: 'macOS-10.13'
NodeVersion: '10.x'
TestTarget: 'node'
Mac_Browser:
OSName: 'Mac'
OSVmImage: 'macOS-10.13'
TestTarget: 'browser'

pool:
vmImage: '$(OSVmImage)'
Expand All @@ -114,9 +62,8 @@ jobs:
displayName: 'rush build:test -t "$(Package)"'

- script: |
node common/scripts/install-run-rush.js integration-test:browser -t "$(Package)" --verbose
condition: succeededOrFailed()
displayName: 'rush integration-test:browser -t "$(Package)"'
node common/scripts/install-run-rush.js integration-test:$(TestTarget) -t "$(Package)" --verbose
displayName: 'rush integration-test:$(TestTarget) -t "$(Package)"'
env:
# Service Bus
AAD_CLIENT_ID: $(aad-azure-sdk-test-client-id)
Expand All @@ -134,8 +81,7 @@ jobs:

- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: "**/test-results.browser.xml"
testRunTitle: '$(OSName) Node $(NodeVersion) - Browser'
testResultsFiles: '**/test-results.xml'
testRunTitle: '$(OSName) Live Tests - $(TestTarget) [Node $(NodeVersion)]'
condition: succeededOrFailed()
displayName: 'Publish browser test results'
displayName: 'Publish test results'
114 changes: 39 additions & 75 deletions .azure-pipelines/client.test.storage.live.yml
Original file line number Diff line number Diff line change
@@ -1,109 +1,75 @@
# External variables:
# Package
# The package to build and test. Defined in pipeline web ui because multiple pipelines use this YAML with different packages.
# Example: @azure/event-hubs
# Example: @azure/storage-blob

variables:
NodeVersion: '10.x'

jobs:
- job: 'Test_Storage_Node'
- job: 'LiveTest'
strategy:
# Service Bus and Event Hubs currently lack support for running multiple test suites in parallel,
# Live tests currently lack support for running multiple test suites in parallel,
# since the tests would attempt to use the same resources which causes conflicts.
maxParallel: 1
matrix:
Linux_Node8X:
Linux_Node8:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
NodeVersion: '8.x'
Linux_Node10X:
TestTarget: 'node'
Linux_Node10:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
NodeVersion: '10.x'
Linux_Node12X:
TestTarget: 'node'
Linux_Node12:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
NodeVersion: '12.x'
Windows_Node8X:
TestTarget: 'node'
Linux_Browser:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
TestTarget: 'browser'
Windows_Node8:
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
NodeVersion: '8.x'
Windows_Node10X:
TestTarget: 'node'
Windows_Node10:
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
NodeVersion: '10.x'
Windows_Node12X:
TestTarget: 'node'
Windows_Node12:
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
NodeVersion: '12.x'
Mac_Node8X:
TestTarget: 'node'
Windows_Browser:
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
TestTarget: 'browser'
Mac_Node8:
OSName: 'Mac'
OSVmImage: 'macOS-10.13'
NodeVersion: '8.x'
Mac_Node10X:
TestTarget: 'node'
Mac_Node10:
OSName: 'Mac'
OSVmImage: 'macOS-10.13'
NodeVersion: '10.x'
Mac_Node12X:
TestTarget: 'node'
Mac_Node12:
OSName: 'Mac'
OSVmImage: 'macOS-10.13'
NodeVersion: '12.x'

pool:
vmImage: '$(OSVmImage)'

timeoutInMinutes: 240

steps:
- task: NodeTool@0
inputs:
versionSpec: '$(NodeVersion)'
displayName: 'Install Node.js $(NodeVersion)'

- script: |
node common/scripts/install-run-rush.js install
displayName: 'Install dependencies'

- script: |
node common/scripts/install-run-rush.js build -t "$(Package)" --verbose
displayName: 'rush build -t "$(Package)"'

- script: |
node common/scripts/install-run-rush.js build:test -t "$(Package)" --verbose
displayName: 'rush build:test -t "$(Package)"'

- script: |
node common/scripts/install-run-rush.js integration-test:node -t "$(Package)" --verbose
displayName: 'rush integration-test:node -t "$(Package)"'
env:
# Storage
ACCOUNT_NAME: $(js-storage-test-account-name)
ACCOUNT_KEY: $(js-storage-test-account-key)
ACCOUNT_SAS: $(js-storage-test-account-sas)

- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: '$(OSName) Node $(NodeVersion) - Node'
condition: succeededOrFailed()
displayName: 'Publish node test results'

- job: 'Test_Storage_Browser'
strategy:
# Service Bus and Event Hubs currently lack support for running multiple test suites in parallel,
# since the tests would attempt to use the same resources which causes conflicts.
maxParallel: 1
matrix:
Linux_Node10X:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
NodeVersion: '10.x'
Windows_Node10X:
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
NodeVersion: '10.x'
Mac_Node10X:
TestTarget: 'node'
Mac_Browser:
OSName: 'Mac'
OSVmImage: 'macOS-10.13'
NodeVersion: '10.x'
TestTarget: 'browser'

pool:
vmImage: '$(OSVmImage)'
Expand All @@ -129,9 +95,8 @@ jobs:
displayName: 'rush build:test -t "$(Package)"'

- script: |
node common/scripts/install-run-rush.js integration-test:browser -t "$(Package)" --verbose
condition: succeededOrFailed()
displayName: 'rush integration-test:browser -t "$(Package)"'
node common/scripts/install-run-rush.js integration-test:$(TestTarget) -t "$(Package)" --verbose
displayName: 'rush integration-test:$(TestTarget) -t "$(Package)"'
env:
# Storage
ACCOUNT_NAME: $(js-storage-test-account-name)
Expand All @@ -140,8 +105,7 @@ jobs:

- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: "**/test-results.browser.xml"
testRunTitle: '$(OSName) Node $(NodeVersion) - Browser'
testResultsFiles: '**/test-results.xml'
testRunTitle: '$(OSName) Live Tests - $(TestTarget) [Node $(NodeVersion)]'
condition: succeededOrFailed()
displayName: 'Publish browser test results'
displayName: 'Publish test results'
3 changes: 2 additions & 1 deletion sdk/servicebus/service-bus/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ module.exports = function(config) {
mocha: {
// change Karma's debug.html to the mocha web reporter
reporter: "html",
timeout: "600000"
timeout: "600000",
grep: " #RunInBrowser"
}
}
});
Expand Down
15 changes: 10 additions & 5 deletions sdk/servicebus/service-bus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,24 @@
"main": "./dist/index.js",
"module": "dist-esm/src/index.js",
"browser": {
"./dist/index.js": "./browser/service-bus.js"
"./dist/index.js": "./browser/service-bus.js",
"./dist-esm/test/utils/aadUtils.js": "./dist-esm/test/utils/aadUtils.browser.js",
"buffer": "buffer",
"stream": "stream-browserify"
},
"types": "./typings/service-bus.d.ts",
"engine": {
"node": ">=6.0.0"
},
"dependencies": {
"@azure/amqp-common": "^1.0.0-preview.5",
"@types/is-buffer": "^2.0.0",
"@azure/ms-rest-nodeauth": "^0.9.2",
"@types/long": "^4.0.0",
"debug": "^3.1.0",
"is-buffer": "^2.0.3",
"long": "^4.0.0",
"process": "^0.11.10",
"rhea": "^1.0.4",
"rhea-promise": "^0.1.15",
"tslib": "^1.9.3"
Expand Down Expand Up @@ -108,9 +113,9 @@
"build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
"build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
"build:samples": "node .scripts/prepSamples.js && cd samples && tsc -p .",
"build:test:browser": "tsc -p . && cross-env BROWSER_TEST=true rollup -c 2>&1",
"build:test:node": "tsc -p . && rollup -c rollup.test.config.js 2>&1",
"build:test": "tsc -p . && cross-env ONLY_NODE=true rollup -c rollup.test.config.js 2>&1",
"build:test:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c rollup.test.config.js 2>&1",
"build:test:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c rollup.test.config.js 2>&1",
"build:test": "npm run build:test:node && npm run build:test:browser",
"build": "tsc -p . && rollup -c 2>&1 && npm run extract-api",
"check-format": "prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm test-dist typings *.tgz *.log coverage coverage-browser .nyc_output",
Expand All @@ -124,7 +129,7 @@
"lint-fix": "eslint -c ../../.eslintrc.json src test samples --ext .ts --fix --fix-type [problem,suggestion]",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"test:browser": "npm run build:test:browser && karma start --single-run",
"test:browser": "npm run build:test:browser && npm run integration-test:browser",
"test:node": "npm run build:test:node && npm run integration-test:node",
"test": "npm run test:node && npm run test:browser",
"unit-test:browser": "echo skipped",
Expand Down
18 changes: 16 additions & 2 deletions sdk/servicebus/service-bus/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ const pkg = require("./package.json");
const depNames = Object.keys(pkg.dependencies);
const input = "dist-esm/src/index.js";

const version = require("./package.json").version;
const banner = [
"/*!",
` * Azure Service Bus SDK for JavaScript, ${version}`,
" * Copyright (c) Microsoft and contributors. All rights reserved.",
" */"
].join("\n");

const ignoreKnownWarnings = (warning) => {
if (warning.code === "THIS_IS_UNDEFINED") {
// This error happens frequently due to TypeScript emitting `this` at the
Expand Down Expand Up @@ -149,12 +157,18 @@ export function browserConfig({ test = false, production = false } = {}) {
baseConfig.onwarn = ignoreKnownWarnings;

if (test) {
baseConfig.input = "dist-esm/test/browserified/*.spec.js";
baseConfig.input = "dist-esm/test/*.spec.js";
baseConfig.plugins.unshift(multiEntry({ exports: false }));
baseConfig.output.file = "test-browser/index.js";
} else if (production) {
baseConfig.output.file = "browser/service-bus.min.js";
baseConfig.plugins.push(terser());
baseConfig.plugins.push(
terser({
output: {
preamble: banner
}
})
);
}

return baseConfig;
Expand Down
Loading