-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Merge is planed on 2019/04/29] Move scripts from this repo. (#5719)
* Breaking Change2 * Experimental lintdiff * No more model/semantic/syntax validations in travis-CI. * Scripts 0.1.8 * Use scripts from @azure/rest-api-specs-scripts * ts-utils * fix breaking changes * momentOfTruthPostProcessing * momentOfTruthPostProcessing.ts * remove 'ts-utils.ts' * Remove `utils` * postToGitHub.ts * switch to momentOfTruthUtils * minor * Syntax.ts * semanticValidation.ts * another try * minor update * URL/fix * OAD ^0.2.13 * update to new scripts. * Use scripts from `sergey/move-from-specs-repo`. * simplified model validation. * preprod * postToGitHub * momentOfTruthPostProcessing * Semantic Validation * getSwaggers() * Use `getExamples()` and `getSwaggers()`. * Update package.json * Remove travis-CI jobs except branch strategy. * remove model and semantic validations version 2.
- Loading branch information
1 parent
03a7910
commit 781c97f
Showing
16 changed files
with
45 additions
and
1,085 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
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
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
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
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 |
---|---|---|
@@ -1,41 +1,6 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License in the project root for license information. | ||
|
||
import { devOps, cli } from '@azure/avocado' | ||
import { utils } from '@azure/rest-api-specs-scripts' | ||
import * as cp from 'child_process' | ||
import { modelValidation } from '@azure/rest-api-specs-scripts' | ||
|
||
const exec = (cmd: string, options?: cp.SpawnSyncOptions) => { | ||
const result = cp.spawnSync( | ||
cmd, | ||
{ | ||
...options, | ||
shell: true, | ||
stdio: [process.stdin, process.stdout, process.stderr] | ||
} | ||
) | ||
return result.status | ||
} | ||
|
||
async function main() { | ||
const pr = await devOps.createPullRequestProperties(cli.defaultConfig()) | ||
const swaggersToProcess = await utils.getFilesChangedInPR(pr); | ||
let result = 0 | ||
for (const swagger of swaggersToProcess) { | ||
try { | ||
// await oav.validateExamples(swagger, null, {consoleLogLevel: 'error', pretty: true}); | ||
// run OAV as a separate process to avoid memory issues. | ||
const r = exec(`node node_modules/oav/dist/cli.js validate-example ${swagger} --pretty`) | ||
if (result === 0) { | ||
result = r | ||
} | ||
} catch (e) { | ||
console.error("error: ") | ||
console.error(e) | ||
result = 1 | ||
} | ||
} | ||
process.exitCode = result | ||
} | ||
|
||
main().catch(e => { console.log(e); process.exit(1); }) | ||
modelValidation.main().catch(e => { console.log(e); process.exit(1); }) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.