Граф коммитов

39 Коммитов

Автор SHA1 Сообщение Дата
Jana R e6db98ecb5
[doc] fixed typos and punctuation (#29225)
Fixed typos and added punctuations to improve readability of README.md
files.

---------

Co-authored-by: Maor Leger <maorleger@users.noreply.github.com>
2024-06-25 07:02:57 -07:00
Will Temple 3d56c95dbf
[dev-tool] Migration framework (#25229)
This PR implements `dev-tool migrate` and related commands.

Design document (PR):
https://github.com/Azure/azure-sdk-for-js/pull/25044/files

(rather than repeat what is already described in detail in that PR, I'll
only summarize it here)

## `dev-tool migrate`

- `dev-tool migrate` allows a developer to start a migration pass,
during which each pending migration will be applied in sequence to the
current package.
- Migrations run four phases, all of which are optional:
- Eligibility check: determines whether or not a migration is applicable
to a package
- Precondition check: determines if the migration can run successfully
(for example, the asset sync migration checks for PowerShell and that
the git config is set)
- Execution: runs the automated migration (if there is one -- migrations
_can_ be manual)
    - Validation: checks the result of the migration
- Any of the four phases may fail, in which case a helpful error will be
printed and the migration will be suspended. You will then need to
manually correct the migration or give up.
- To give up, use `dev-tool migrate --abort`. This will cancel the
suspended migration and leave the working tree dirty.
- If you correct the migration manually, you can run `dev-tool migrate
--continue` to pick up where the previous command left off.
- You also have `--list` to list pending migrations, `--list-applied` to
list applied migrations, and `--has=<id>` to determine whether or not a
migration has been applied.

## `dev-tool admin create-migration`

Creating a migration is easy. You just run `dev-tool admin
create-migration`. It will prompt you for a migration id & description
as well as optional URL. Then it will instantiate the migration template
and open the new migration in VS Code (if you called the script from
within a vscode terminal). From there, writing a migration is as simple
as implementing a function for each of the phases you want to enable in
the migration.

## Initial migrations

- `sample-config-to-metadata`: moves the `//sampleConfiguration` to
`//metadata` in a package.json file (this is a minor hygiene thing that
can only be justified by doing it automatically).
- `onboard/test-proxy-asset-sync`: onboards a package that uses the
recorder to the test proxy asset sync tool. This migration demonstrates
all of the features of migrations, including how to check for
preconditions, check eligibility, execute & validate, and it shows how
to add new files to the git index if a migration creates a file.

---------

Co-authored-by: Jeff Fisher <xirzec@xirzec.com>
Co-authored-by: Timo van Veenendaal <me@timo.nz>
2023-05-03 09:21:18 -04:00
Jeremy Meng b03348a145
[smoke-tests] skip overriding version for dependency not managed in this repo (#22532)
* [smoke-tests] skip overriding version for dependency not managed in this repo

`@azure/msal-node` is not managed in this repo, so we should keep the version
specified in package.json.

* Update common/smoke-test/Initialize-SmokeTests.ps1

Co-authored-by: Albert Cheng <38804567+ckairen@users.noreply.github.com>

Co-authored-by: Albert Cheng <38804567+ckairen@users.noreply.github.com>
2022-07-11 21:38:00 +00:00
Jeremy Meng 191e4ce330 [EngSys] prepare for upgrading TypeScript to v4.6
Before upgrading we want to address the breaking change of catch variable now
defaulting to `unkown` by explicitly specify `: any` for implicit `any` catch
variables in our code base.

This commit applies the result of running the following codemod (credit: Maor)

```ts
import { API, FileInfo } from "jscodeshift";
export default function transformer(file: FileInfo, api: API) {
  const j = api.jscodeshift;
  const code = j(file.source);
  code
    .find(j.CatchClause)
    .filter(({ node }) => {
      return node.param && node.param.type == "Identifier" && !node.param.typeAnnotation;
    })
    .forEach(({ node }) => {
      if (node.param.type == "Identifier") {
        node.param.typeAnnotation = j.tsTypeAnnotation(j.tsAnyKeyword());
      }
    });
  return code.toSource();
}
```
2022-04-19 12:11:57 -07:00
Jeremy Meng 388fa9782f
[engsys] improve smoke test runner (#20872)
- previously the runner load sample modules in main(). Any error would cause
main() to exit thus skipping rest of tests. Now the samples are loaded when they
are executed so errors in loading modules can be caught.

- the consumeEventsFromServiceBusQueue sample is calling `process.exit()` upon
completion, causing the runner to exit because it currently runs tests in-proc.
Update the test to exit with code 1 when failing.
2022-03-30 10:54:46 -07:00
Jonathan Cárdenas d5fe48454f
Increase timeout from 15 to 30 minutes (#18107) 2021-10-28 13:50:12 -07:00
ckairen 075e47e82d
Accounting for packages without samples (#17765) 2021-09-21 16:31:16 -07:00
ckairen b85b05a28f
Smoke test isolation per package (#17528)
* Smoke test isolation per package

* PR mod

* Error msg clarity
2021-09-10 15:35:21 -07:00
Chidozie Ononiwu a64747cf6a Rename hardcoded master links to use main 2021-06-22 15:51:16 -07:00
Mike Harder 96e203b010
Add Node 8 to smoke test matrix (#14623)
- Use NodeTestVersion after samples are prepared
  - dev-tool is not compatible with Node 8
- Use readdirSync() for Node 8 compat
- Add --harmony_async_iteration flag for Node 8
  - Samples depend on async iterators
2021-04-22 10:43:37 -07:00
Ben Broderick Phillips f4cf4198c0
Use base platform matrix for CI tests (#14647)
* Rename common test job files to be consistent with other repos

* Move ci tests into their own file and call via matrix generation job

* Use common platform matrix for ci tests
2021-04-05 12:49:49 -04:00
Ben Broderick Phillips c93b7aabb6
Avoid null error when no samples are found (#14250) 2021-03-11 19:02:40 +00:00
Will Temple 9e4a451cb2
[dev-tool][smoke-tests] Use same configuration for skippable samples in live environments (#13515)
* [dev-tool] Use //sampleConfiguration for skips

* Replace all instances of smokeTestConfiguration with sampleConfiguration

* Formatting

* Tested file matching logic

* removed a left-over import
2021-02-03 17:55:30 -05:00
Ben Broderick Phillips e143e875d8
Run smoke test samples after package release (#12929)
* Run smoke test samples after package release

* Simplify smoke test eligibility check

* Add DryRun mode to smoke test initialization script. Simplify smoke test on release check

* [smoke test] Rename Nightly argument to Daily

* Remove separate job and conditionals for smoke test eligibility output

* Minor pipeline fixes

* Use ubuntu 18 vmimage for smoke test eligibility check job

* Add node version template to smoke test eligibility check

* Skip smoke tests when run manifest is empty

* Remove redundant NodeVersion parameter

* Disable digital twins smoke tests temporarily

* Disable form recognizer smoke test files
2021-02-01 13:32:13 -05:00
Mike Harder e07f7d8d7f
Use pre-installed Azure PowerShell modules (#12230) 2020-11-02 17:58:50 -08:00
Ben Broderick Phillips 2caa2f37c5
Disable sovereign cloud smoke tests (#12233) 2020-11-02 20:56:32 -05:00
Ben Broderick Phillips 5e3293fd0b
Add canary region and node LTS coverage to smoke test matrix (#11812)
* Cover more Node LTS versions in smoke test sparse matrix

* Use NodeTestVersion variable and template in smoke test matrix

* Revert to using use-node-version template directly, as smoke tests don't need pnpm

* Update smoke test titles to include node versions. Remove failing entries
2020-10-20 15:05:39 -04:00
Ben Broderick Phillips e944cd3fc6
Parallelize smoke test resource deployments. Improve script readability. (#11895)
* Refactor Initialize-SmokeTests.ps1 script for readability

* Parallelize smoke test resource deploys. Use idiomatic function names.

* Filter jobs started from the initialize smoke test script. Add job timeout.

* Use common logging functions

* [smoke tests] Remove deploy jobs in finally block
2020-10-20 13:12:50 -04:00
Sima Zhu 3bae7c754d
Revert the formatting changes. (#11888) 2020-10-16 12:49:36 -07:00
Wes Haggard 35ae12c2c4 Fix anchor links so they work when converting to html 2020-10-16 09:34:53 -07:00
Ben Broderick Phillips 1b5a5fec01
Elaborate on smoke test initialize logic in docs and script. Update .gitignore. (#11802)
* Elaborate on smoke test initialize logic in docs and script. Update .gitignore.

* Clarify NODE_PATH variable setting when running smoke tests locally

* Move smoke test .gitignore entries to git root
2020-10-15 13:41:36 -04:00
Sima Zhu add2f4fb1b
Replaced relative link with absolute links and remove locale (#11317)
Replaced relative link with absolute links and remove locale
2020-09-17 20:01:20 -07:00
Danny Amirault 0376980fc4
Ensure smoke tests initialization outputs exception message (#10971) 2020-09-03 13:09:54 -07:00
Daniel Jurek d81d479ec9
Smoke Test rearchitecture: deploy test resources and opt-out samples (#8388)
* add ability to skip smoke tests based on the presence of environment variables

parameterize test-resources.json

disable cosmos db smoke testing in china cloud

add --ci to smoke test execution

add yargs to smoke tests

smoke tests: @types/yargs is unnecessary, add await in app

turns out @types/yargs is required

use KeyVaultSecrets instead of this

incremental sample compiling progress

first cut at using sample format for smoke tests

Smoke test deploys, onboards samples

Fix pre-samples.js

Add environment variable output to New-TestResources.ps1

Update smoke test package.json

Update-SmokeTests.ps1 - variable outputs for CI, start documenting

New-TestResources.ps1 output environment variables

Update smoke tests yaml

* Remove Smoke Test resources in yaml

* parameters

* Update smoke-tests.yml

* Fix prep-samples.js

* Remove extra *

* Formatting for prep-samples.js

* Revert "Remove extra *"

This reverts commit f0c1b3f36b474f09d2cd49ee2abb327ad0236f10.

* Move Node version higher so Update-SmokeTests.ps1 can use it

* node run.js

* Set AZURE_RESOURCEGROUP_NAME at the top level so delete scripts can clean up after

* Add run.js

* Give ability to specify blank service directory in remove-test-resources.yml

* Add ability to specify resource group name directly to New-TestResources.ps1

* Add devops logging for smoke test failures

* Better command layout

* Update KV test resources to include KEYVAULT_URI for samples

* Fix App Config and KV to use environment variables from the test-resources.json

* Add in package.json configuration to skip certain failing files in smoke tests

* Add ability to skip samples based on configuration information in package.json

* Remove ArmTemplateParameters from smoke tests

* Delete test resources after 24 hours

* Add contacts.js (timing out) to skip

* Add deleteAndRecover.js to skip list

* Skip backupAndRestore.js in KV Secrets

* Improve smoke test error logging

* Skip useProxy.js in Service Bus smoke tests

* Use ARM template params in sovereign clouds

* Remove base smoke test cases

* Use configruable storage endpoint suffix in event hub ARM template

* Use baseName for the basis of the GUID

* Set environment variables from standard config

* Set sample directory when running each test to preserve sample context

* Idempotent naming

* Force $CI to $false

* Use proces.cwd() instead of __dirname

* Skip samples where confiugrations are not present in test-resources.json

* Add support for storage endpoint suffix to storage test-resources.json

* Also exclude copyModel.js

* Compute account name for text analytics so we don't collied with test resources that have the same name

* Add endpoint information for cognitive services

* Skip some storage tests because of hardcoded endpoint suffix

* Skip ai-text-analytics pending further investigation

* Proper spelling for customPipeline

* New-TestResources -- if $CI is true AND a ResourceGroupName is specified, do not mututae the $BaseName

* Always generate a new $BaseName when $CI is $true. If we don't do this and reuse $BaseName then multiple resources of the same type might get deployed with the same name and there will be collisions

* Remove samples-manifest.json

* Use static name for cognitive services user role assignment to avoid smoke test collision

* Form Recognizer should use resource group location

* Role assignment names must be GUIDs

* Update search SKU so deployment succeeds

* Fix form recognizer and text analytrics ARM templates to assign RBAC roles directly to the resources

* Unique guid for Text Analytrics role assignment

* Use relative paths in Initialize-SmokeTests.ps1

* Add --use-packages to samples prep to use package references instead of source references

* Move //smokeTestConfiguration from samples package.json to the package's package.json

* Add in better path support

* Update Smoke Test README.md

* Use globbing to find samples/javascript folders inside packages

* Remove extra files

* Remove hard coded test cases

* Remove smoke-test/test-resources.json

* Use context to set AZURE_AUTHORITY_HOST

* Spacing

* Document -ResourceGroupName parameter

* workingDirector -> workingDirectory

* no inputs

* Skip template samples as the samples do not run properly

* Set environment variables for test application in the initilize script

* Exclude authenticationMethods.js and recognizeContent.js samples because of smoke test errors

* Remove setting AZURE_AUTHORITY_HOST in New-TestResources.ps1 and set it in Initialize-SmokeTest.ps1

* Review feedback: use APPCONFIG_CONNECTION_STRING in samples and tests

* Review feedback KEYVAULT_NAME -> KEYVAULT_URI in all samples and docs for KV

* Make sample.env files consistent

* Skip deploying and onboarding when there is no test-resources.json file
2020-08-05 09:03:44 -07:00
Jonathan Turner 2b8247a0f9
[Identity] Changes for the out-of-band identity release (#10177)
* Changes for the out-of-band identity release

* Export new option bags

* touchup

* Add docs

* Add docs
2020-07-23 08:42:35 +12:00
Mike Harder b037d6e63e
Verify node version after install (#9498) 2020-06-12 09:23:30 -07:00
Daniel Jurek 0f2edec2ea
Smoke Tests use new subscription configuration template (#8940)
* smoke tests use subscription configuration
* update archetype-sdk-integration.yml as well
* editor confiugration always adds extra new line at end of file. Remove this so the files from eng/common remain untouched
2020-05-15 20:37:59 -07:00
Daniel Jurek 535c041c95
Add ServiceDirectory parameter to usages of remove-tests-resources.yml (#8597)
* add ServiceDirectory parameter to usages of remove-tests-resources.yml

* revert changes to a file in eng/common
2020-04-29 15:56:06 -07:00
Jeremy Meng e251ff8a8e
Update contributing sections to link to CONTRIBUTING.md (#8486)
* Update contributing sections to link to CONTRIBUTING.md

* Update the contributing section for rest of libraries

* Remove old CONTRIBUTING.md files

README should point to the main CONTRIBUTING.md under repository root.

We did similar changes earlier (e.g., 73f7f90c4) however these seem leftover
that got missed.

* Link to storage specific contributing guide
2020-04-24 09:56:02 -07:00
Daniel Jurek 6625478180
smoke tests: include core packages (#8429) 2020-04-21 15:18:37 -07:00
Daniel Jurek 887106e2b9
Temporarily disable Cosmos DB smoke testing (#8308)
* temporarily disable cosmosdb smoke testing

* fix compile failure
2020-04-10 14:53:58 -07:00
Daniel Jurek a57ee61ed5
Change China smoke testing region (#8265) 2020-04-08 17:34:24 -07:00
Daniel Jurek 555fe0c03e
Smoke tests use dynamic test resources (#8076)
* add smoke test ARM template and pipeline wiring
* add mapping via AZURE_AUTHORITY_HOST_ALIAS
* rename AZURE_AUTHORITY_HOST_ALIAS -> AZURE_CLOUD
* rename authorityHostAlias -> azureCloud
2020-04-02 14:20:45 -07:00
Daniel Jurek 23d8e5c449
Smoke Test: use configurable authority host (#7795)
* add support for authority host and pipelines
* add direct @azure/identity dependency
* set AZURE_AUTHORITY_HOST
* smoke tests use connection string instead of account/key/url combination
2020-03-14 15:44:39 -07:00
Daniel Jurek e78fdce2f1
correct location for globals.yml (#7007) 2020-01-17 14:20:15 -08:00
Daniel Jurek dfa9d32fc6
Smoke test nightly packages (#6871)
* set start position explicitly

* smoke tests: add set-dev-packages.ts

* use current version of Event Hubs, use dev versions in azure dependencies in package.json

* move smoke tests pipeline to smoke test folder

* update smoke test variable locaiton

* update smoke test variable locaiton

* Revert "update smoke test variable locaiton"

This reverts commit a3a8911c1a.

* Revert "update smoke test variable locaiton"

This reverts commit 7982a9d4b8.

* Revert "move smoke tests pipeline to smoke test folder"

This reverts commit aeb9c27ea3.

* add logging for installed packages, remove package-lock.json

* add matrix

* matrix is part of a strategy

* it's an npm custom command

* delete `set-dev-packages.ts`

* now with quotes around the custom command...

* add step to install TypeScript on the agent

* correctly tab displayName and condition

* case insensitive

* move smoke-tests.yml for better alerting
2020-01-16 14:40:08 -08:00
Daniel Jurek d4e259b7b0
update smoke tests, use latest released versions (#6783) 2020-01-07 10:10:49 -08:00
Jeremy Meng 92f7e835a0
[Storage] Enable doc-warden checking for storage READMEs (#6660)
* [Storage] Enable doc-warden checking for storage READMEs

as they should have required headings now.

* Change docSetting to expect JavaScript in headings instead of JS
2019-12-30 11:14:42 -08:00
Daniel Jurek 97d2de7918
Move smoke tests to common (#5774)
* move smoke tests
* move documentation
* Revert "move documentation"
This reverts commit 5cc21e851effdc18572179a954fe8df14bef3da0.
* move smoke tests to common
* npm install for smoke-tests
* revert interface change (needs to happen in step with package version updates)
2019-11-07 10:31:42 -08:00