Skip to content
Snippets Groups Projects
Commit 68b5089c authored by Nathaniel Kofalt's avatar Nathaniel Kofalt
Browse files

Tune test cases

parent 9351279f
No related branches found
No related tags found
No related merge requests found
......@@ -6,5 +6,5 @@
/runtime
bootstrap.json
.cache
.coverage
/.coverage*
coverage.xml
{
"name": "dcm_convert",
"name": "test-case-gear",
"manifest": {
"config": {},
"name": "test-case-gear",
"label": "Test Case Gear",
"version": "0",
"author": "Nathaniel Kofalt",
"description": "A gear built to drive test cases",
"url": "http://none.example",
"source": "http://none.example",
"license": "MIT",
"config": {
"two-digit multiple of ten": {
"exclusiveMaximum": true,
"type": "number",
"multipleOf": 10,
"maximum": 100
}
},
"inputs": {
"dicom": {
"any text file <= 100 KB": {
"base": "file",
"type": {
"enum": [
"dicom"
]
"name": {
"pattern": "^.*.txt$"
},
"size": {
"maximum": 100000
}
}
}
}
}
\ No newline at end of file
},
"input": {}
}
{
"gear": "dcm_convert",
"inputs": {
"dicom": {
"type": "acquisition",
"id": "573c9e6a844eac7fc01747cd",
"name" : "1_1_dicom.zip"
}
},
"destination": {
"type": "acquisition",
"id": "573c9e6a844eac7fc01747cd"
},
"tags": [
"ad-hoc"
]
"gear": "test-case-gear",
"inputs": {
"dicom": {
"type": "acquisition",
"id": "573c9e6a844eac7fc01747cd",
"name" : "1_1_dicom.zip"
}
},
"config": {
"two-digit multiple of ten": 20
},
"destination": {
"type": "acquisition",
"id": "573c9e6a844eac7fc01747cd"
},
"tags": [
"ad-hoc"
]
}
......@@ -2,7 +2,7 @@ var hooks = require('hooks');
// Variables for passing results as input to subsequent tests
var job_id = '';
var gear_name = '';
var gear_name = 'test-case-gear';
var group_id = 'test_group';
// Tests we're skipping, fix these
......@@ -140,14 +140,14 @@ hooks.before("GET /gears/{GearName} -> 200", function(test, done) {
hooks.before("POST /gears/{GearName} -> 200", function(test, done) {
test.request.params = {
GearName: "dcm_convert"
GearName: gear_name
};
done();
});
hooks.before("GET /gears/{GearName} -> 200", function(test, done) {
test.request.params = {
GearName: "dcm_convert"
GearName: gear_name
};
done();
});
......
......@@ -2,7 +2,7 @@
"variables": [],
"info": {
"name": "test",
"_postman_id": "90e24cfd-f35f-ae05-7248-c066527bf096",
"_postman_id": "fc8f9020-aa70-327d-4e99-9c8a98db1009",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
......@@ -118,35 +118,6 @@
},
"response": []
},
{
"name": "Add dcm-convert gear",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": "tests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response time is less than 200ms\"] = responseTime < 200;"
}
}
],
"request": {
"url": "{{baseUri}}/gears/dcm-convert?root=true",
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "scitran-user {{test_user_api_key}}",
"description": ""
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"name\": \"dcm-convert\",\n\t\"manifest\": {\n\t\t\"config\": {},\n\t\t\"inputs\": {\n\t\t\t\"dicom\": {\n\t\t\t\t\"base\": \"file\",\n\t\t\t\t\"type\": {\n\t\t\t\t\t\"enum\": [\n\t\t\t\t\t\t\"dicom\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t\"input\": {}\n}"
},
"description": ""
},
"response": []
},
{
"name": "Create test-group",
"event": [
......@@ -297,7 +268,8 @@
"key": "file",
"src": "test/integration_tests/postman/test_files/test-1.dcm",
"type": "file",
"enabled": true
"enabled": true,
"value": ""
}
]
},
......@@ -306,19 +278,19 @@
"response": []
},
{
"name": "Add job",
"name": "Submit invalid gear",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": "tests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response time is less than 200ms\"] = responseTime < 200;"
"exec": "tests[\"Status code is 400\"] = responseCode.code === 400;"
}
}
],
"request": {
"url": "{{baseUri}}/jobs/add",
"method": "POST",
"url": "{{baseUri}}/gears/test_gear?root=true",
"method": "post",
"header": [
{
"key": "Authorization",
......@@ -328,26 +300,26 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"gear\": \"dcm-convert\",\n \"inputs\": {\n \"dicom\": {\n \"type\": \"acquisition\",\n \"id\": \"{{test-acquisition-id}}\",\n \"name\" : \"1_1_dicom.zip\"\n }\n },\n \"destination\": {\n \"type\": \"acquisition\",\n \"id\": \"{{test-acquisition-id}}\"\n },\n \"tags\": [\n \"ad-hoc\"\n ]\n}\n"
"raw": "{\n\t\"category\": \"converter\",\n\t\"input\": { },\n\t\"name\": \"test_gear\",\n\t\"manifest\": {\n\t\t\"name\": \"test_gear\",\n\t\t\"inputs\": {\n\t\t\t\"any text file <= 100 KB\": {\n\t\t\t\t\"base\": \"file\",\n\t\t\t\t\"name\": {\n\t\t\t\t\t\"pattern\": \"^.*.txt$\"\n\t\t\t\t},\n\t\t\t\t\"size\": {\n\t\t\t\t\t\"maximum\": 100000\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"description\": \"A gear to test the API\",\n\t\t\"license\": \"Other\",\n\t\t\"author\": \"\",\n\t\t\"url\": \"https://unknown.example\",\n\t\t\"label\": \"An exported gear\",\n\t\t\"source\": \"https://unknown.example\",\n\t\t\"config\": {\n\t\t\t\"two-digit multiple of ten\": {\n\t\t\t\t\"exclusiveMaximum\": true,\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"multipleOf\": 10,\n\t\t\t\t\"maximum\": 100\n\t\t\t}\n\t\t}\n\t}\n}"
},
"description": ""
"description": "Create or update a gear.\n\"Name\" field of gear must match \"GearName\" uri parameter\nIf no existing gear is found, one will be created\nOtherwise, the specified gear will be updated\n\n\nParameters:\n\nGearName: Name of the gear to interact with\n\n"
},
"response": []
},
{
"name": "Submit invalid gear",
"name": "Add test-case-gear gear",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": "tests[\"Status code is 400\"] = responseCode.code === 400;"
"exec": "tests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response time is less than 200ms\"] = responseTime < 200;"
}
}
],
"request": {
"url": "{{baseUri}}/gears/test_gear?root=true",
"method": "post",
"url": "{{baseUri}}/gears/test-case-gear?root=true",
"method": "POST",
"header": [
{
"key": "Authorization",
......@@ -357,26 +329,26 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\"category\": \"converter\",\n\t\"input\": { },\n\t\"name\": \"test_gear\",\n\t\"manifest\": {\n\t\t\"name\": \"test_gear\",\n\t\t\"inputs\": {\n\t\t\t\"any text file <= 100 KB\": {\n\t\t\t\t\"base\": \"file\",\n\t\t\t\t\"name\": {\n\t\t\t\t\t\"pattern\": \"^.*.txt$\"\n\t\t\t\t},\n\t\t\t\t\"size\": {\n\t\t\t\t\t\"maximum\": 100000\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"description\": \"A gear to test the API\",\n\t\t\"license\": \"Other\",\n\t\t\"author\": \"\",\n\t\t\"url\": \"https://unknown.example\",\n\t\t\"label\": \"An exported gear\",\n\t\t\"source\": \"https://unknown.example\",\n\t\t\"config\": {\n\t\t\t\"two-digit multiple of ten\": {\n\t\t\t\t\"exclusiveMaximum\": true,\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"multipleOf\": 10,\n\t\t\t\t\"maximum\": 100\n\t\t\t}\n\t\t}\n\t}\n}"
"raw": "{\n\t\"name\": \"test-case-gear\",\n\t\"manifest\": {\n\t\t\"name\": \"test-case-gear\",\n\t\t\"label\": \"Test Case Gear\",\n\t\t\"version\": \"0\",\n\t\t\n\t\t\"author\": \"Nathaniel Kofalt\",\n\t\t\"description\": \"A gear built to drive test cases\",\n\t\t\n\t\t\"url\": \"http://none.example\",\n\t\t\"source\": \"http://none.example\",\n\t\t\"license\": \"MIT\",\n\t\t\n\t\t\"config\": {\n\t\t\t\"two-digit multiple of ten\": {\n\t\t\t\t\"exclusiveMaximum\": true,\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"multipleOf\": 10,\n\t\t\t\t\"maximum\": 100\n\t\t\t}\n\t\t},\n\t\t\n\t\t\"inputs\": {\n\t\t\t\"any text file <= 100 KB\": {\n\t\t\t\t\"base\": \"file\",\n\t\t\t\t\"name\": {\n\t\t\t\t\t\"pattern\": \"^.*.txt$\"\n\t\t\t\t},\n\t\t\t\t\"size\": {\n\t\t\t\t\t\"maximum\": 100000\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t\"input\": {}\n}"
},
"description": "Create or update a gear.\n\"Name\" field of gear must match \"GearName\" uri parameter\nIf no existing gear is found, one will be created\nOtherwise, the specified gear will be updated\n\n\nParameters:\n\nGearName: Name of the gear to interact with\n\n"
"description": ""
},
"response": []
},
{
"name": "Submit valid gear",
"name": "Add job",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": "tests[\"Status code is 200\"] = responseCode.code === 200;"
"exec": "tests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response time is less than 200ms\"] = responseTime < 200;"
}
}
],
"request": {
"url": "{{baseUri}}/gears/test-gear?root=true",
"method": "post",
"url": "{{baseUri}}/jobs/add",
"method": "POST",
"header": [
{
"key": "Authorization",
......@@ -386,9 +358,9 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\"category\": \"converter\",\n\t\"input\": { },\n\t\"name\": \"test-gear\",\n\t\"manifest\": {\n\t\t\"name\": \"test-gear\",\n\t\t\"inputs\": {\n\t\t\t\"any text file <= 100 KB\": {\n\t\t\t\t\"base\": \"file\",\n\t\t\t\t\"name\": {\n\t\t\t\t\t\"pattern\": \"^.*.txt$\"\n\t\t\t\t},\n\t\t\t\t\"size\": {\n\t\t\t\t\t\"maximum\": 100000\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"description\": \"A gear to test the API\",\n\t\t\"license\": \"Other\",\n\t\t\"author\": \"\",\n\t\t\"version\": \"0\",\n\t\t\"url\": \"https://unknown.example\",\n\t\t\"label\": \"An exported gear\",\n\t\t\"source\": \"https://unknown.example\",\n\t\t\"config\": {\n\t\t\t\"two-digit multiple of ten\": {\n\t\t\t\t\"exclusiveMaximum\": true,\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"multipleOf\": 10,\n\t\t\t\t\"maximum\": 100\n\t\t\t}\n\t\t}\n\t}\n}"
"raw": "{\n \"gear\": \"test-case-gear\",\n \"inputs\": {\n \"dicom\": {\n \"type\": \"acquisition\",\n \"id\": \"{{test-acquisition-id}}\",\n \"name\" : \"1_1_dicom.zip\"\n }\n },\n \"config\": {\n\t\t\"two-digit multiple of ten\": 20\n\t},\n \"destination\": {\n \"type\": \"acquisition\",\n \"id\": \"{{test-acquisition-id}}\"\n },\n \"tags\": [\n \"ad-hoc\"\n ]\n}\n"
},
"description": "Create or update a gear.\n\"Name\" field of gear must match \"GearName\" uri parameter\nIf no existing gear is found, one will be created\nOtherwise, the specified gear will be updated\n\n\nParameters:\n\nGearName: Name of the gear to interact with\n\n"
"description": ""
},
"response": []
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment