Fix api tests and update swagger (#38)
* add copy swagger * fix git job config test * update swagger
This commit is contained in:
Родитель
aa94781cc1
Коммит
9ecda2d6ec
|
@ -5,3 +5,4 @@ node_modules
|
|||
.vscode/settings.json
|
||||
.tests/
|
||||
.lib/
|
||||
lib/
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
var exec = require('child_process').exec;
|
||||
var os = require('os');
|
||||
|
||||
function puts(error, stdout, stderr) {
|
||||
if (error) {
|
||||
console.log(error);
|
||||
}
|
||||
console.error(stderr);
|
||||
console.log(stdout);
|
||||
}
|
||||
|
||||
if (os.type() === 'Linux')
|
||||
exec("cp src/api/v2/swagger.yaml lib/src/api/v2/swagger.yaml", puts);
|
||||
else if (os.type() === 'Darwin')
|
||||
exec("cp src/api/v2/swagger.yaml lib/src/api/v2/swagger.yaml", puts);
|
||||
else if (os.type() === 'Windows_NT')
|
||||
exec("copy src\\api\\v2\\swagger.yaml lib\\src\\api\\v2\\swagger.yaml", puts);
|
||||
else
|
||||
throw new Error("Unsupported OS found: " + os.type());
|
|
@ -16,7 +16,8 @@
|
|||
"preapi-test": "ts-node -r tsconfig-paths/register tests/common/apiTestCaseGenerator.ts -- \"src/api/v2/swagger.yaml\" \".tests/apiTestCase.json\"",
|
||||
"api-test": "mocha -r ts-node/register -r tsconfig-paths/register tests/api_tests/**/*.spec.ts -t 20000",
|
||||
"prebuild": "tslint --config tslint.json --project tsconfig.build.json",
|
||||
"build": "ttsc -p tsconfig.json"
|
||||
"build": "ttsc -p tsconfig.json && npm run copy-swagger",
|
||||
"copy-swagger": "node copy_swagger.js"
|
||||
},
|
||||
"homepage": "https://github.com/Microsoft/openpaisdk",
|
||||
"repository": {
|
||||
|
|
|
@ -216,7 +216,7 @@ paths:
|
|||
- user
|
||||
- admin
|
||||
'400':
|
||||
description: NoUserError or IncorrectPassworkError
|
||||
description: NoUserError or IncorrectPasswordError
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
|
@ -1014,7 +1014,7 @@ paths:
|
|||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- name: user
|
||||
- name: username
|
||||
in: query
|
||||
description: filter jobs with username
|
||||
schema:
|
||||
|
@ -2017,6 +2017,8 @@ components:
|
|||
- type: object
|
||||
description: other/unknown type
|
||||
properties: {}
|
||||
readOnly:
|
||||
type: boolean
|
||||
secretName:
|
||||
type: string
|
||||
mountOptions:
|
||||
|
@ -2252,16 +2254,16 @@ components:
|
|||
- email
|
||||
- extension
|
||||
responses:
|
||||
IncorrectPassworkError:
|
||||
description: IncorrectPassworkError
|
||||
IncorrectPasswordError:
|
||||
description: IncorrectPasswordError
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Response'
|
||||
examples:
|
||||
IncorrectPassworkError:
|
||||
IncorrectPasswordError:
|
||||
value:
|
||||
code: IncorrectPassworkError
|
||||
code: IncorrectPasswordError
|
||||
message: Password is incorrect.
|
||||
NoVirtualClusterError:
|
||||
description: NoVirtualClusterError
|
||||
|
|
|
@ -876,7 +876,10 @@ export const ApiDefaultTestCases: {[key: string]: IApiTestCase} = {
|
|||
type: 'raw',
|
||||
value: 'sdk_test_nonexist_job'
|
||||
}
|
||||
]
|
||||
],
|
||||
response: {
|
||||
statusCode: 404
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
Загрузка…
Ссылка в новой задаче