biothings / biothings_explorer

TRAPI service for BioThings Explorer
https://explorer.biothings.io
Apache License 2.0
10 stars 11 forks source link

Fix failing tests #320

Closed colleenXu closed 2 years ago

colleenXu commented 2 years ago

I notice these tests failing, likely due to changes in handling text mining APIs (provenance situation c w/ edge attributes, pagination). I'll add more comments as I review...

see latest comments for details on the fails. Currently bte-trapi and call-apis are the modules where tests are consistently failing


EDIT: this is outdated; ignore rest of this comment

This repo (bte-trapi):

colleenXu commented 2 years ago

call-apis:

colleenXu commented 2 years ago

EDIT: fixed by the merged PR mentioned below.

~query-graph-handler:~

colleenXu commented 2 years ago

EDIT: not failing now. Maybe was a transient thing...

~currently finding some tests failing in biomedical id resolver....~

expand here ➜ biomedical_id_resolver git:(main) ✗ npm test > biomedical_id_resolver@3.10.0 test > jest PASS __tests__/unittest/utils.test.ts PASS __tests__/unittest/bioentity.test.ts PASS __tests__/validate.test.ts PASS __tests__/scheduler.test.ts PASS __tests__/integration/generate_invalid_bioentities.test.ts PASS __tests__/integration/biolink_based_validator.test.ts PASS __tests__/integration/sri_resolver.test.ts (8.391 s) node:internal/process/promises:246 triggerUncaughtException(err, true /* fromPromise */); ^ [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Error: timeout of 30000ms exceeded".] { code: 'ERR_UNHANDLED_REJECTION' } FAIL __tests__/builder.test.ts (31.516 s) ● Test BioThingsQueryBuilder Class › test buildOneQuery function › test with gene inputs timeout of 30000ms exceeded at createError (../../node_modules/axios/lib/core/createError.js:16:15) at XMLHttpRequest.handleTimeout (../../node_modules/axios/lib/adapters/xhr.js:111:14) at XMLHttpRequest.invokeTheCallbackFunction (../../node_modules/jsdom/lib/jsdom/living/generated/EventHandlerNonNull.js:18:28) at XMLHttpRequest. (../../node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js:35:32) at innerInvokeEventListeners (../../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:338:25) at invokeEventListeners (../../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:274:3) at XMLHttpRequestImpl._dispatch (../../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:221:9) at fireAnEvent (../../node_modules/jsdom/lib/jsdom/living/helpers/events.js:18:36) at Timeout.properties.timeoutFn [as _onTimeout] (../../node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:707:13) FAIL __tests__/integration/resolver_factory.test.ts (31.703 s) ● Test Resolver module › Resolver class should be set correctly if given type biolink expect(received).toContain(expected) // indexOf Expected value: "NamedThing" Received array: ["NoncodingRnaProduct"] 7 | const resolver = new Resolver('biolink'); 8 | const res = await resolver.resolve({ "NamedThing": ["NCBIGene:1017"] }); > 9 | expect(res["NCBIGene:1017"][0].semanticTypes).toContain("NamedThing"); | ^ 10 | expect(res['NCBIGene:1017'][0].semanticType).toEqual("Gene"); 11 | }) 12 | at Object. (__tests__/integration/resolver_factory.test.ts:9:55) node:internal/process/promises:246 triggerUncaughtException(err, true /* fromPromise */); ^ [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Error: timeout of 30000ms exceeded".] { code: 'ERR_UNHANDLED_REJECTION' } FAIL __tests__/integration/biolink_based_resolver.test.ts (192.452 s) ● Test ID Resolver › Test valid inputs should be corretly resolved expect(received).toHaveProperty(path) Expected path: "NCBIGene:1017" Received path: [] Received value: {} 12 | expect(res['NCBIGene:1017'][0]).toBeInstanceOf(ResolvableBioEntity); 13 | expect(res['NCBIGene:1017'][0].primaryID).toEqual("NCBIGene:1017"); > 14 | expect(res['NCBIGene:1017'][0].label).toEqual("CDK2") | ^ 15 | }) 16 | 17 | test("Test BioThings output include integer should be converted to string", async () => { at Object. (__tests__/integration/biolink_based_resolver.test.ts:14:21) ● Test ID Resolver › Test valid inputs from multiple semantic types should be corretly resolved expect(received).toHaveProperty(path) Expected path: "NCBIGene:1017" Received path: [] Received value: {"DRUGBANK:DB01609": [{"_attributes": {"chembl_max_phase": ["4"], "chembl_molecule_type": ["Small molecule"], "contraindications": ["Kidney disease", "Dehydration", "Hearing loss", "Gastrointestinal hemorrhage", "Gastrointestinal ulcer", "Thrombocytopenic disorder", "Cirrhosis of liver", "Primary malignant neoplasm", "Disease of liver", "Anemia", "Agranulocytosis", "Acute nephropathy", "Multiple organ failure", "Neutropenic disorder", "Impaired renal function disorder", "Myelodysplastic syndrome", "Proteinuria", "Hepatic failure", "Bilateral cataracts", "Liver function tests abnormal", "Hyperbilirubinemia", "Ocular hypertension"], "fda_epc_pharmacology_class": ["Iron Chelator"], "indications": ["Chronic Iron Overload", "beta Thalassemia"], "mesh_pharmacology_class": ["Chelating Agents", "Iron Chelating Agents", "Sequestering Agents"]}, "_dbIDs": {"CAS": ["201530-41-8"], "CHEBI": ["CHEBI:49005"], "CHEMBL.COMPOUND": ["CHEMBL550348"], "DRUGBANK": ["DB01609"], "INCHI": ["InChI=1S/C21H15N3O4/c25-17-7-3-1-5-15(17)19-22-20(16-6-2-4-8-18(16)26)24(23-19)14-11-9-13(10-12-14)21(27)28/h1-12,25-26H,(H,27,28)", "InChI=1S/C21H15N3O4/c25-17-7-3-1-5-15(17)19-22-20(16-6-2-4-8-18(16)26)24(23-19)14-11-9-13(10-12-14)21(27)28/h1-12,22-23H,(H,27,28)/b19-15-,20-16+"], "INCHIKEY": ["BOFQWVMAQOTZIW-UHFFFAOYSA-N"], "LINCS": ["LSM-45297"], "MESH": ["C415250"], "PUBCHEM.COMPOUND": ["214348", "5493381"], "UMLS": ["C1619629"], "UNII": ["V8G4MOF2V9"], "name": ["DEFERASIROX", "deferasirox"]}, "_leafSemanticType": "SmallMolecule", "_semanticTypes": ["SmallMolecule", "MolecularEntity", "ChemicalEntity", "NamedThing", "Entity"]}]} 27 | expect(res).toHaveProperty("NCBIGene:1017"); 28 | expect(res['NCBIGene:1017']).toHaveLength(1); > 29 | expect(res['NCBIGene:1017'][0]).toBeInstanceOf(ResolvableBioEntity); | ^ 30 | expect(res['NCBIGene:1017'][0].primaryID).toEqual("NCBIGene:1017"); 31 | expect(res['NCBIGene:1017'][0].label).toEqual("CDK2"); 32 | expect(res).toHaveProperty("DRUGBANK:DB01609"); at Object. (__tests__/integration/biolink_based_resolver.test.ts:29:21) ● Test ID Resolver › Test inputs with NamedThing semanticType should be corretly resolved expect(received).toHaveLength(expected) Expected length: 2 Received length: 1 Received array: [{"_leafSemanticType": "NoncodingRnaProduct", "curie": "NCBIGene:1017"}] 63 | test("Test inputs with NamedThing semanticType should be corretly resolved", async () => { 64 | const resolver = new BioLinkBasedResolver(); > 65 | const res = await resolver.resolve({ "NamedThing": ["NCBIGene:1017"] }); | ^ 66 | expect(res).toHaveProperty("NCBIGene:1017"); 67 | expect(res["NCBIGene:1017"]).toHaveLength(2); 68 | expect(res['NCBIGene:1017'][0]).toBeInstanceOf(ResolvableBioEntity); at Object. (__tests__/integration/biolink_based_resolver.test.ts:65:38) ● Test ID Resolver › Test Irresolvable inputs should not overwrite the result of a valid input expect(received).toHaveLength(expected) Expected length: 2 Received length: 1 Received array: [{"_leafSemanticType": "Disease", "curie": "NCBIGene:1017"}] 105 | expect(res['OMIM1:116953'][0]).toBeInstanceOf(IrresolvableBioEntity); 106 | expect(res['OMIM1:116953'][0].semanticType).toEqual("undefined"); > 107 | }) | ^ 108 | 109 | test("Test Irresolvable inputs should not overwrite the result of a valid input", async () => { 110 | const resolver = new BioLinkBasedResolver(); at Object. (__tests__/integration/biolink_based_resolver.test.ts:107:38) ● Test ID Resolver › Test input with multiple colons in it should just be classified as irresolvable but not cause an error expect(received).toHaveProperty(path) Expected path: "NCBIGene:GENE:1017" Received path: [] Received value: {} 114 | expect(res['NCBIGene:1017'][0]).toBeInstanceOf(ResolvableBioEntity); 115 | expect(res['NCBIGene:1017'][0].primaryID).toEqual("NCBIGene:1017"); > 116 | expect(res['NCBIGene:1017'][0].label).toEqual("CDK2"); | ^ 117 | expect(res['NCBIGene:1017'][1]).toBeInstanceOf(IrresolvableBioEntity); 118 | }) 119 | at Object. (__tests__/integration/biolink_based_resolver.test.ts:116:21) FAIL __tests__/integration/default_resolver.test.ts (213.486 s) ● Console console.log { 'SNOMEDCT:49455004': [ ResolvableBioEntity { _leafSemanticType: 'Disease', _dbIDs: [Object], _attributes: {} } ] } at Object. (__tests__/integration/default_resolver.test.ts:206:17) console.log { 'NCIT:C116936': [ ResolvableBioEntity { _leafSemanticType: 'Disease', _dbIDs: [Object], _attributes: {} } ] } at Object. (__tests__/integration/default_resolver.test.ts:212:17) ● Test ID Resolver › Test valid inputs should be corretly resolved expect(received).toHaveProperty(path) Expected path: "NCBIGene:1017" Received path: [] Received value: {} 12 | expect(res['NCBIGene:1017'][0]).toBeInstanceOf(ResolvableBioEntity); 13 | expect(res['NCBIGene:1017'][0].primaryID).toEqual("NCBIGene:1017"); > 14 | expect(res['NCBIGene:1017'][0].label).toEqual("CDK2") | ^ 15 | }) 16 | 17 | test("Test symbol should be resolved to corresponding human gene", async () => { at Object. (__tests__/integration/default_resolver.test.ts:14:21) ● Test ID Resolver › Test Protein Uniprot ID should be resolved expect(received).toHaveProperty(path) Expected path: "UniProtKB:P24941" Received path: [] Received value: {} 39 | const res = await resolver.resolve({ "Protein": ["UniProtKB:P24941"] }); 40 | expect(res).toHaveProperty("UniProtKB:P24941"); > 41 | expect(res['UniProtKB:P24941']).toHaveLength(1); | ^ 42 | expect(res['UniProtKB:P24941'][0]).toBeInstanceOf(ResolvableBioEntity); 43 | expect(res['UniProtKB:P24941'][0].primaryID).toEqual("UniProtKB:P24941"); 44 | expect(res['UniProtKB:P24941'][0].dbIDs.ENSEMBL).toContain("ENSP00000243067") at Object. (__tests__/integration/default_resolver.test.ts:41:21) ● Test ID Resolver › Test Protein ENSEMBL ID should be resolved expect(received).toHaveProperty(path) Expected path: "ENSEMBL:ENSP00000243067" Received path: [] Received value: {} 48 | const resolver = new DefaultIDResolver(); 49 | const res = await resolver.resolve({ "Protein": ["ENSEMBL:ENSP00000243067"] }); > 50 | expect(res).toHaveProperty("ENSEMBL:ENSP00000243067"); | ^ 51 | expect(res['ENSEMBL:ENSP00000243067']).toHaveLength(1); 52 | expect(res['ENSEMBL:ENSP00000243067'][0]).toBeInstanceOf(ResolvableBioEntity); 53 | expect(res['ENSEMBL:ENSP00000243067'][0].primaryID).toEqual("UniProtKB:P24941"); at Object. (__tests__/integration/default_resolver.test.ts:50:21) ● Test ID Resolver › Test inputs with undefined semanticType and could be mapped to multiple semantictypes using OMIM ID as example should be corretly resolved expect(received).toBeInstanceOf(expected) Expected constructor: ResolvableBioEntity Received constructor: IrresolvableBioEntity 137 | const valid = res["UMLS:C0008780"].filter(rec => rec instanceof ResolvableBioEntity); 138 | expect(valid).toHaveLength(2); > 139 | expect(valid[0].semanticType).toEqual("PhenotypicFeature"); | ^ 140 | expect(valid[1].primaryID).toEqual("MONDO:0016575"); 141 | expect(valid[1].label).toEqual("primary ciliary dyskinesia"); 142 | expect(valid[1].semanticType).toEqual("Disease"); at Object. (__tests__/integration/default_resolver.test.ts:139:39) ● Test ID Resolver › Test Irresolvable inputs should not overwrite the result of a valid input expect(received).toHaveLength(expected) Expected length: 2 Received length: 1 Received array: [{"_leafSemanticType": "Disease", "curie": "NCBIGene:1017"}] 153 | }) 154 | > 155 | test("Test inputs with undefined semanticType and could not be mapped to any semantic type should return Irresolvable", async () => { | ^ 156 | const resolver = new DefaultIDResolver(); 157 | const res = await resolver.resolve({ "undefined": ["OMIM1:116953"] }); 158 | expect(res).toHaveProperty("OMIM1:116953"); at Object. (__tests__/integration/default_resolver.test.ts:155:38) Test Suites: 4 failed, 7 passed, 11 total Tests: 12 failed, 3 skipped, 101 passed, 116 total Snapshots: 0 total Time: 214.797 s Ran all test suites.
colleenXu commented 2 years ago

currently for bte-trapi I'm getting more failed tests:

Test Suites: 3 failed, 1 skipped, 10 passed, 13 of 14 total Tests: 13 failed, 11 skipped, 44 passed, 68 total Snapshots: 0 total Time: 313.848 s

with some queries saying stuff like this: : Timeout - Async callback was not invoked within the 300000 ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 300000 ms timeout specified by jest.setTimeout.Error:

colleenXu commented 2 years ago

for call-apis: Test Suites: 2 failed, 7 passed, 9 total Tests: 3 failed, 71 passed, 74 total Snapshots: 0 total Time: 2.687 s, estimated 14 s

colleenXu commented 2 years ago

Note that in bte-trapi, the v1query.test.js takes a particularly long time to run (> 5min)

current report from npm test for bte-trapi ``` > @biothings-explorer/bte-trapi@2.8.1 test > jest --forceExit --env node PASS __test__/unittest/routes/performance.test.js PASS __test__/unittest/routes/predicates.test.js PASS __test__/unittest/routes/metakg.test.js PASS __test__/integration/routes/entry.test.js PASS __test__/unittest/routes/predicates_team.test.js PASS __test__/unittest/utils.test.js PASS __test__/integration/routes/performance.test.js PASS __test__/integration/controllers/association.test.js (8.09 s) PASS __test__/integration/routes/metakg.test.js (10.319 s) FAIL __test__/integration/routes/v1query_by_api.test.js (15.465 s) ● Testing /v1/smartapi/{smartapi_id}/query endpoints › Input query graph missing nodes definition should return 400 expected 400 "Bad Request", got 500 "Internal Server Error" 29 | .send(query_with_nodes_undefined) 30 | .set('Accept', 'application/json') > 31 | .expect(400) | ^ 32 | .expect('Content-Type', /json/) 33 | .then(response => { 34 | expect(response.body).toHaveProperty("error", "Your input query graph is invalid"); at Object. (__test__/integration/routes/v1query_by_api.test.js:31:14) ---- at Test.Object..Test._assertStatus (../../../node_modules/supertest/lib/test.js:304:12) at ../../../node_modules/supertest/lib/test.js:80:15 at Test.Object..Test._assertFunction (../../../node_modules/supertest/lib/test.js:338:11) at Test.Object..Test.assert (../../../node_modules/supertest/lib/test.js:209:21) at Server.localAssert (../../../node_modules/supertest/lib/test.js:167:12) ● Testing /v1/smartapi/{smartapi_id}/query endpoints › Input query graph missing edges definition should return 400 error expected 400 "Bad Request", got 500 "Internal Server Error" 42 | .send(query_with_edges_undefined) 43 | .set('Accept', 'application/json') > 44 | .expect(400) | ^ 45 | .expect('Content-Type', /json/) 46 | .then(response => { 47 | expect(response.body).toHaveProperty("error", "Your input query graph is invalid"); at Object. (__test__/integration/routes/v1query_by_api.test.js:44:14) ---- at Test.Object..Test._assertStatus (../../../node_modules/supertest/lib/test.js:304:12) at ../../../node_modules/supertest/lib/test.js:80:15 at Test.Object..Test._assertFunction (../../../node_modules/supertest/lib/test.js:338:11) at Test.Object..Test.assert (../../../node_modules/supertest/lib/test.js:209:21) at Server.localAssert (../../../node_modules/supertest/lib/test.js:167:12) ● Testing /v1/smartapi/{smartapi_id}/query endpoints › Input query graph with nodes and edges mismatch should return 400 error expected 400 "Bad Request", got 500 "Internal Server Error" 55 | .send(query_with_nodes_and_edges_not_match) 56 | .set('Accept', 'application/json') > 57 | .expect(400) | ^ 58 | .expect('Content-Type', /json/) 59 | .then(response => { 60 | expect(response.body).toHaveProperty("error", "Your input query graph is invalid"); at Object. (__test__/integration/routes/v1query_by_api.test.js:57:14) ---- at Test.Object..Test._assertStatus (../../../node_modules/supertest/lib/test.js:304:12) at ../../../node_modules/supertest/lib/test.js:80:15 at Test.Object..Test._assertFunction (../../../node_modules/supertest/lib/test.js:338:11) at Test.Object..Test.assert (../../../node_modules/supertest/lib/test.js:209:21) at Server.localAssert (../../../node_modules/supertest/lib/test.js:167:12) ● Testing /v1/smartapi/{smartapi_id}/query endpoints › Query to non-Text Mining KPs should have id resolution turned on expect(received).toHaveProperty(path) Expected path: "UniProtKB:O15554" Received path: [] Received value: (removing from report that I'm pasting here because it's so large) 87 | .expect('Content-Type', /json/) 88 | .then(response => { > 89 | expect(response.body.message.knowledge_graph.nodes).toHaveProperty("UniProtKB:O15554") | ^ 90 | }) 91 | }) 92 | at __test__/integration/routes/v1query_by_api.test.js:89:69 at Object. (__test__/integration/routes/v1query_by_api.test.js:82:9) ● Testing /v1/smartapi/{smartapi_id}/query endpoints › Query to Text Mining Co-occurrence KP should be correctly paginated TypeError: Cannot read properties of undefined (reading 'attributes') 102 | .expect('Content-Type', /json/) 103 | .then(response => { > 104 | expect(response.body.message.knowledge_graph.nodes["CHEBI:26404"].attributes[0].value).toEqual(["CHEBI:26404"]) | ^ 105 | expect(Object.keys(response.body.message.knowledge_graph.nodes)).toHaveLength(hits + 1) 106 | }) 107 | }) at __test__/integration/routes/v1query_by_api.test.js:104:83 at Object. (__test__/integration/routes/v1query_by_api.test.js:97:9) FAIL __test__/integration/routes/v1query_by_team.test.js (32.084 s) ● Testing /v1/team/{team_name}/query endpoints › Input query graph missing nodes definition should return 400 expected 400 "Bad Request", got 500 "Internal Server Error" 29 | .send(query_with_nodes_undefined) 30 | .set('Accept', 'application/json') > 31 | .expect(400) | ^ 32 | .expect('Content-Type', /json/) 33 | .then(response => { 34 | expect(response.body).toHaveProperty("error", "Your input query graph is invalid"); at Object. (__test__/integration/routes/v1query_by_team.test.js:31:14) ---- at Test.Object..Test._assertStatus (../../../node_modules/supertest/lib/test.js:304:12) at ../../../node_modules/supertest/lib/test.js:80:15 at Test.Object..Test._assertFunction (../../../node_modules/supertest/lib/test.js:338:11) at Test.Object..Test.assert (../../../node_modules/supertest/lib/test.js:209:21) at Server.localAssert (../../../node_modules/supertest/lib/test.js:167:12) ● Testing /v1/team/{team_name}/query endpoints › Input query graph missing edges definition should return 400 error expected 400 "Bad Request", got 500 "Internal Server Error" 42 | .send(query_with_edges_undefined) 43 | .set('Accept', 'application/json') > 44 | .expect(400) | ^ 45 | .expect('Content-Type', /json/) 46 | .then(response => { 47 | expect(response.body).toHaveProperty("error", "Your input query graph is invalid"); at Object. (__test__/integration/routes/v1query_by_team.test.js:44:14) ---- at Test.Object..Test._assertStatus (../../../node_modules/supertest/lib/test.js:304:12) at ../../../node_modules/supertest/lib/test.js:80:15 at Test.Object..Test._assertFunction (../../../node_modules/supertest/lib/test.js:338:11) at Test.Object..Test.assert (../../../node_modules/supertest/lib/test.js:209:21) at Server.localAssert (../../../node_modules/supertest/lib/test.js:167:12) ● Testing /v1/team/{team_name}/query endpoints › Input query graph with nodes and edges mismatch should return 400 error expected 400 "Bad Request", got 500 "Internal Server Error" 55 | .send(query_with_nodes_and_edges_not_match) 56 | .set('Accept', 'application/json') > 57 | .expect(400) | ^ 58 | .expect('Content-Type', /json/) 59 | .then(response => { 60 | expect(response.body).toHaveProperty("error", "Your input query graph is invalid"); at Object. (__test__/integration/routes/v1query_by_team.test.js:57:14) ---- at Test.Object..Test._assertStatus (../../../node_modules/supertest/lib/test.js:304:12) at ../../../node_modules/supertest/lib/test.js:80:15 at Test.Object..Test._assertFunction (../../../node_modules/supertest/lib/test.js:338:11) at Test.Object..Test.assert (../../../node_modules/supertest/lib/test.js:209:21) at Server.localAssert (../../../node_modules/supertest/lib/test.js:167:12) ● Testing /v1/team/{team_name}/query endpoints › Query to Text Mining Co-occurrence KP should be correctly paginated TypeError: Cannot read properties of undefined (reading 'attributes') 107 | .expect('Content-Type', /json/) 108 | .then(response => { > 109 | expect(response.body.message.knowledge_graph.nodes["CHEBI:26404"].attributes[0].value).toEqual(["CHEBI:26404"]) | ^ 110 | expect(Object.keys(response.body.message.knowledge_graph.nodes)).toHaveLength(hits + 1) 111 | }) 112 | }) at __test__/integration/routes/v1query_by_team.test.js:109:83 at runMicrotasks () at Object. (__test__/integration/routes/v1query_by_team.test.js:102:9) PASS __test__/integration/TRAPIv1.1.test.js (37.2 s) FAIL __test__/integration/routes/v1query.test.js (309.145 s) ● Testing /v1/query endpoints › Input query graph missing nodes definition should return 400 expected 400 "Bad Request", got 500 "Internal Server Error" 28 | .send(query_with_nodes_undefined) 29 | .set('Accept', 'application/json') > 30 | .expect(400) | ^ 31 | .expect('Content-Type', /json/) 32 | .then(response => { 33 | expect(response.body).toHaveProperty("error", "Your input query graph is invalid"); at Object. (__test__/integration/routes/v1query.test.js:30:14) ---- at Test.Object..Test._assertStatus (../../../node_modules/supertest/lib/test.js:304:12) at ../../../node_modules/supertest/lib/test.js:80:15 at Test.Object..Test._assertFunction (../../../node_modules/supertest/lib/test.js:338:11) at Test.Object..Test.assert (../../../node_modules/supertest/lib/test.js:209:21) at Server.localAssert (../../../node_modules/supertest/lib/test.js:167:12) ● Testing /v1/query endpoints › Input query graph missing edges definition should return 400 error expected 400 "Bad Request", got 500 "Internal Server Error" 41 | .send(query_with_edges_undefined) 42 | .set('Accept', 'application/json') > 43 | .expect(400) | ^ 44 | .expect('Content-Type', /json/) 45 | .then(response => { 46 | expect(response.body).toHaveProperty("error", "Your input query graph is invalid"); at Object. (__test__/integration/routes/v1query.test.js:43:14) ---- at Test.Object..Test._assertStatus (../../../node_modules/supertest/lib/test.js:304:12) at ../../../node_modules/supertest/lib/test.js:80:15 at Test.Object..Test._assertFunction (../../../node_modules/supertest/lib/test.js:338:11) at Test.Object..Test.assert (../../../node_modules/supertest/lib/test.js:209:21) at Server.localAssert (../../../node_modules/supertest/lib/test.js:167:12) ● Testing /v1/query endpoints › Input query graph with nodes and edges mismatch should return 400 error expected 400 "Bad Request", got 500 "Internal Server Error" 54 | .send(query_with_nodes_and_edges_not_match) 55 | .set('Accept', 'application/json') > 56 | .expect(400) | ^ 57 | .expect('Content-Type', /json/) 58 | .then(response => { 59 | expect(response.body).toHaveProperty("error", "Your input query graph is invalid"); at Object. (__test__/integration/routes/v1query.test.js:56:14) ---- at Test.Object..Test._assertStatus (../../../node_modules/supertest/lib/test.js:304:12) at ../../../node_modules/supertest/lib/test.js:80:15 at Test.Object..Test._assertFunction (../../../node_modules/supertest/lib/test.js:338:11) at Test.Object..Test.assert (../../../node_modules/supertest/lib/test.js:209:21) at Server.localAssert (../../../node_modules/supertest/lib/test.js:167:12) ● Testing /v1/query endpoints › Multi-hop query results should have combined edges : Timeout - Async callback was not invoked within the 300000 ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 300000 ms timeout specified by jest.setTimeout.Error: 61 | }) 62 | > 63 | test("Multi-hop query results should have combined edges", async () => { | ^ 64 | const query = JSON.parse(fs.readFileSync(path.join(example_folder, "query_multihop_gene_gene_chemical.json"))); 65 | await request(app) 66 | .post("/v1/query") at new Spec (../../../node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22) at Suite. (__test__/integration/routes/v1query.test.js:63:5) A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks. Test Suites: 3 failed, 1 skipped, 10 passed, 13 of 14 total Tests: 13 failed, 11 skipped, 44 passed, 68 total Snapshots: 0 total Time: 310.171 s Ran all test suites. Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished? ```
colleenXu commented 2 years ago

Also providing the call-apis report

report ``` > @biothings-explorer/call-apis@1.24.0 test > jest --env=node PASS __test__/logentry.test.js PASS __test__/query_queue.test.js PASS __test__/template_funcs.test.js FAIL __test__/trapi_query_builder.test.js ● test trapi query builder class › test getConfig function › test if server url has a trailing slash expect(received).toHaveProperty(path, value) Expected path: "timeout" Expected value: 10000 Received value: 50000 24 | const res = builder.getConfig(); 25 | expect(res).toHaveProperty('url', 'https://google.com/query'); > 26 | expect(res).toHaveProperty('timeout', 10000); | ^ 27 | expect(res.data.message.query_graph.nodes.n0.ids).toEqual(['123', '456']); 28 | expect(res.data.message.query_graph.nodes.n0.categories).toContain('biolink:Pathway'); 29 | expect(res.data.message.query_graph.nodes.n1.categories).toContain('biolink:Gene'); at Object. (__test__/trapi_query_builder.test.js:26:25) PASS __test__/query_bucket.test.js PASS __test__/query_builder.test.js PASS __test__/template_query_builder.test.js PASS __test__/query.test.js FAIL __test__/integration/integration.test.js (21.878 s) ● Integration test › Integration test using mygene.info gene to biological process association › check response expect(received).toHaveLength(expected) Expected length: 29 Received length: 23 Received array: (not pasting because it's long) 15 | const query = new q([edge]); 16 | const res = await query.query(); > 17 | expect(res).toHaveLength(29); | ^ 18 | }) 19 | }) 20 | at Object. (__test__/integration/integration.test.js:17:25) ● Integration test › Integration test using text mining co-occurrence KP for disease to chemical association › check response : Timeout - Async callback was not invoked within the 10000 ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 10000 ms timeout specified by jest.setTimeout.Error: 26 | edge = JSON.parse(fs.readFileSync(edge_path)); 27 | }) > 28 | test("check response", async () => { | ^ 29 | const query = new q([edge]); 30 | const res = await query.query(false); 31 | expect(res).toHaveLength(3762); at new Spec (../../../node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22) at Suite. (__test__/integration/integration.test.js:28:9) ● Integration test › Integration test using fake error api query that should return 404 error › check response : Timeout - Async callback was not invoked within the 10000 ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 10000 ms timeout specified by jest.setTimeout.Error: 40 | edge = JSON.parse(fs.readFileSync(edge_path)); 41 | }) > 42 | test("check response", async () => { | ^ 43 | const query = new q([edge]); 44 | const res = await query.query(false); 45 | expect(res).toHaveLength(0); at new Spec (../../../node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22) at Suite. (__test__/integration/integration.test.js:42:9) A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks. Test Suites: 2 failed, 7 passed, 9 total Tests: 4 failed, 70 passed, 74 total Snapshots: 0 total Time: 22.811 s ```
colleenXu commented 2 years ago

EDIT: And now I'm not seeing failing tests...weird...keeping the rest of the comment below just in case


Now seeing failing tests in query-graph-handler.

the report ``` ➜ query_graph_handler git:(main) ✗ npm test > @biothings-explorer/query_graph_handler@1.18.0 test > jest --env=node PASS __test__/integration/graph/graph.test.js PASS __test__/unittest/helper.test.js PASS __test__/integration/QueryResult.test.js PASS __test__/integration/KnowledgeGraph.test.js PASS __test__/integration/QueryNode.test.js PASS __test__/integration/QueryResult_2.test.js PASS __test__/unittest/LogEntry.test.js PASS __test__/integration/QueryGraphHandler.test.js FAIL __test__/integration/QEdge2BTEEdgeHandler.test.js ● Testing NodeUpdateHandler Module › Testing _getEquivalentIDs function › test edge with one curie input return an object with one key ReferenceError: performance is not defined 137 | } 138 | async function _resolveSRI(userInput) { > 139 | let startTime = performance.now(); | ^ 140 | let uniqueInputIDs = combineInputs(userInput); 141 | let endTime = performance.now(); 142 | debug(`Querying SRI for ${uniqueInputIDs.length} IDs. Took ${endTime - startTime}ms to calculate unique ids.`); at Object._resolveSRI (../../biomedical_id_resolver/built/sri.js:139:21) at Object.resolveSRI (../../biomedical_id_resolver/built/index.js:33:24) at NodesUpdateHandler._getEquivalentIDs (src/update_nodes.js:40:45) at Object. (__test__/integration/QEdge2BTEEdgeHandler.test.js:55:43) ● Testing NodeUpdateHandler Module › Testing _getEquivalentIDs function › test edge with multiple curie input return an object with multiple key ReferenceError: performance is not defined 137 | } 138 | async function _resolveSRI(userInput) { > 139 | let startTime = performance.now(); | ^ 140 | let uniqueInputIDs = combineInputs(userInput); 141 | let endTime = performance.now(); 142 | debug(`Querying SRI for ${uniqueInputIDs.length} IDs. Took ${endTime - startTime}ms to calculate unique ids.`); at Object._resolveSRI (../../biomedical_id_resolver/built/sri.js:139:21) at Object.resolveSRI (../../biomedical_id_resolver/built/index.js:33:24) at NodesUpdateHandler._getEquivalentIDs (src/update_nodes.js:40:45) at Object. (__test__/integration/QEdge2BTEEdgeHandler.test.js:61:43) PASS __test__/unittest/utils.test.js PASS __test__/integration/biolink.test.js PASS __test__/unittest/QueryEdge.test.js PASS __test__/integration/QueryEdge.test.js FAIL __test__/integration/TRAPIQueryHandler.test.js ● Testing TRAPIQueryHandler Module › Testing query function › test with one query edge ReferenceError: performance is not defined 137 | } 138 | async function _resolveSRI(userInput) { > 139 | let startTime = performance.now(); | ^ 140 | let uniqueInputIDs = combineInputs(userInput); 141 | let endTime = performance.now(); 142 | debug(`Querying SRI for ${uniqueInputIDs.length} IDs. Took ${endTime - startTime}ms to calculate unique ids.`); at Object._resolveSRI (../../biomedical_id_resolver/built/sri.js:139:21) at Object.resolveSRI (../../biomedical_id_resolver/built/index.js:33:24) at NodesUpdateHandler._getEquivalentIDs (src/update_nodes.js:40:45) at NodesUpdateHandler.setEquivalentIDs_2 (src/update_nodes.js:81:38) at BatchEdgeQueryHandler.query_2 (src/batch_edge_query.js:147:22) at TRAPIQueryHandler.query_2 (src/index.js:166:31) at Object. (__test__/integration/TRAPIQueryHandler.test.js:29:13) PASS __test__/integration/BatchEdgeQueryHandler.test.js FAIL __test__/integration/integrity.test.js ● Testing TRAPIQueryHandler Module › When looking for genes related to Disease DYSKINESIA, FAMILIAL, WITH FACIAL MYOKYMIA, ACDY5 should pop up ReferenceError: performance is not defined 137 | } 138 | async function _resolveSRI(userInput) { > 139 | let startTime = performance.now(); | ^ 140 | let uniqueInputIDs = combineInputs(userInput); 141 | let endTime = performance.now(); 142 | debug(`Querying SRI for ${uniqueInputIDs.length} IDs. Took ${endTime - startTime}ms to calculate unique ids.`); at Object._resolveSRI (../../biomedical_id_resolver/built/sri.js:139:21) at Object.resolveSRI (../../biomedical_id_resolver/built/index.js:33:24) at NodesUpdateHandler._getEquivalentIDs (src/update_nodes.js:40:45) at NodesUpdateHandler.setEquivalentIDs_2 (src/update_nodes.js:81:38) at BatchEdgeQueryHandler.query_2 (src/batch_edge_query.js:147:22) at TRAPIQueryHandler.query_2 (src/index.js:166:31) at Object. (__test__/integration/integrity.test.js:23:9) PASS __test__/unittest/redisClient.test.js Test Suites: 3 failed, 1 skipped, 14 passed, 17 of 18 total Tests: 4 failed, 3 skipped, 150 passed, 157 total Snapshots: 0 total Time: 4.242 s, estimated 6 s ```
colleenXu commented 2 years ago

will wait a bit to see if tests keep popping up with errors, now that linked PRs were merged.

colleenXu commented 2 years ago

well....still having failed tests...

bte-trapi report ``` ➜ bte-trapi git:(main) ✗ npm test > @biothings-explorer/bte-trapi@2.8.1 test > jest --forceExit --env node FAIL __test__/integration/controllers/association.test.js ● Test association module › If obj specified, should only return associations related to the obj expect(received).toBeGreaterThan(expected) Expected: > 1 Received: 0 25 | const outputTypes = new Set(res.map(item => item.object)); 26 | const inputTypes = new Set(res.map(item => item.subject)); > 27 | expect(inputTypes.size).toBeGreaterThan(1); | ^ 28 | expect(Array.from(outputTypes)).toHaveLength(1); 29 | expect(Array.from(outputTypes)).toEqual(['SmallMolecule']) 30 | }) at Object. (__test__/integration/controllers/association.test.js:27:33) ● Test association module › If pred specified, should only return associations related to the pred expect(received).toBeGreaterThan(expected) Expected: > 1 Received: 0 34 | const preds = new Set(res.map(item => item.predicate)); 35 | const inputTypes = new Set(res.map(item => item.subject)); > 36 | expect(inputTypes.size).toBeGreaterThan(1); | ^ 37 | expect(Array.from(preds)).toHaveLength(1); 38 | expect(Array.from(preds)).toEqual(['treats']) 39 | }) at Object. (__test__/integration/controllers/association.test.js:36:33) ● Test association module › If source specified, should only return associations related to the source expect(received).toBeGreaterThan(expected) Expected: > 1 Received: 0 52 | const sources = new Set(res.map(item => item.provided_by)); 53 | const inputTypes = new Set(res.map(item => item.subject)); > 54 | expect(inputTypes.size).toBeGreaterThan(1); | ^ 55 | expect(Array.from(sources)).toHaveLength(1); 56 | expect(Array.from(sources)).toEqual(['infores:disgenet']) 57 | }) at Object. (__test__/integration/controllers/association.test.js:54:33) ● Test association module › If both sub and obj specified, should only return associations related to both sub and obj expect(received).toHaveLength(expected) Expected length: 1 Received length: 0 Received array: [] 61 | const outputTypes = new Set(res.map(item => item.object)); 62 | const inputTypes = new Set(res.map(item => item.subject)); > 63 | expect(Array.from(inputTypes)).toHaveLength(1); | ^ 64 | expect(Array.from(outputTypes)).toHaveLength(1); 65 | expect(Array.from(inputTypes)).toEqual(['Gene']); 66 | expect(Array.from(outputTypes)).toEqual(['SmallMolecule']); at Object. (__test__/integration/controllers/association.test.js:63:40) PASS __test__/unittest/utils.test.js PASS __test__/unittest/routes/performance.test.js (5.391 s) PASS __test__/integration/routes/performance.test.js (5.418 s) PASS __test__/unittest/routes/predicates.test.js (5.422 s) PASS __test__/unittest/routes/predicates_team.test.js (5.439 s) PASS __test__/unittest/routes/metakg.test.js (5.449 s) FAIL __test__/integration/routes/metakg.test.js (5.572 s) ● Test /metakg endpoint › Should return 200 with valid response using default values expect(received).toBeGreaterThan(expected) Expected: > 100 Received: 18 11 | .then((response) => { 12 | expect(response.body).toHaveProperty("associations"); > 13 | expect(response.body.associations.length).toBeGreaterThan(100); | ^ 14 | }) 15 | }) 16 | at __test__/integration/routes/metakg.test.js:13:59 at Object. (__test__/integration/routes/metakg.test.js:7:9) ● Test /metakg endpoint › Should return 200 with valid response when user specify provided by expect(received).toEqual(expected) // deep equality - Expected - 3 + Received + 1 - Array [ - "infores:disgenet", - ] + Array [] 35 | expect(response.body).toHaveProperty("associations"); 36 | const res = Array.from(new Set(response.body.associations.map(item => item.provided_by))); > 37 | expect(res).toEqual(['infores:disgenet']); | ^ 38 | }) 39 | }) 40 | at __test__/integration/routes/metakg.test.js:37:29 at Object. (__test__/integration/routes/metakg.test.js:30:9) ● Test /metakg endpoint › Should return 200 with valid response when user specify both subject and object expect(received).toEqual(expected) // deep equality - Expected - 3 + Received + 1 - Array [ - "Gene", - ] + Array [] 83 | const objs = Array.from(new Set(response.body.associations.map(item => item.object))); 84 | const subjs = Array.from(new Set(response.body.associations.map(item => item.subject))); > 85 | expect(objs).toEqual(['Gene']); | ^ 86 | expect(subjs).toEqual(['SmallMolecule']); 87 | }) 88 | }) at __test__/integration/routes/metakg.test.js:85:30 at Object. (__test__/integration/routes/metakg.test.js:77:9) ● Test /metakg endpoint › Should return info from TRAPI /meta_knowledge_graph endpoint expect(received).toContain(expected) // indexOf Expected value: "BioLink API" Received array: ["MyGene.info API"] 96 | expect(response.body).toHaveProperty("associations"); 97 | const apis = Array.from(new Set(response.body.associations.map(item => item.api.name))); > 98 | expect(apis).toContain("BioLink API"); | ^ 99 | }) 100 | }) 101 | }) at __test__/integration/routes/metakg.test.js:98:30 at Object. (__test__/integration/routes/metakg.test.js:91:9) PASS __test__/integration/routes/entry.test.js PASS __test__/integration/routes/v1query_by_team.test.js (8.62 s) PASS __test__/integration/routes/v1query.test.js (8.632 s) FAIL __test__/integration/TRAPIv1.1.test.js (8.71 s) ● Testing v1.1 endpoints › GET /v1/meta_knowledge_graph expect(received).toEqual(expected) // deep equality Expected: ArrayContaining [ObjectContaining {"object": "biolink:Gene", "predicate": "biolink:entity_positively_regulates_entity", "subject": "biolink:SmallMolecule"}] Received: [{"object": "biolink:Gene", "predicate": "biolink:has_participant", "subject": "biolink:Pathway"}, {"object": "biolink:Pathway", "predicate": "biolink:participates_in", "subject": "biolink:Gene"}, {"object": "biolink:BiologicalProcess", "predicate": "biolink:participates_in", "subject": "biolink:Gene"}, {"object": "biolink:MolecularActivity", "predicate": "biolink:enables", "subject": "biolink:Gene"}, {"object": "biolink:CellularComponent", "predicate": "biolink:located_in", "subject": "biolink:Gene"}, {"object": "biolink:Disease", "predicate": "biolink:related_to", "subject": "biolink:Gene"}, {"object": "biolink:Gene", "predicate": "biolink:homologous_to", "subject": "biolink:Gene"}, {"object": "biolink:Gene", "predicate": "biolink:has_participant", "subject": "biolink:BiologicalProcess"}, {"object": "biolink:Gene", "predicate": "biolink:enabled_by", "subject": "biolink:MolecularActivity"}, {"object": "biolink:Gene", "predicate": "biolink:location_of", "subject": "biolink:CellularComponent"}, {"object": "biolink:Gene", "predicate": "biolink:related_to", "subject": "biolink:Disease"}] 28 | 29 | expect(response.body).toHaveProperty("edges"); > 30 | expect(response.body.edges).toEqual( | ^ 31 | expect.arrayContaining([ 32 | expect.objectContaining({ 33 | "subject": "biolink:SmallMolecule", at __test__/integration/TRAPIv1.1.test.js:30:45 at Object. (__test__/integration/TRAPIv1.1.test.js:20:9) ● Testing v1.1 endpoints › GET /v1/team/{team_name}/meta_knowledge_graph expect(received).toEqual(expected) // deep equality Expected: ArrayContaining [ObjectContaining {"object": "biolink:Gene", "predicate": "biolink:is_sequence_variant_of", "subject": "biolink:SequenceVariant"}] Received: [{"object": "biolink:Gene", "predicate": "biolink:has_participant", "subject": "biolink:Pathway"}, {"object": "biolink:Pathway", "predicate": "biolink:participates_in", "subject": "biolink:Gene"}, {"object": "biolink:BiologicalProcess", "predicate": "biolink:participates_in", "subject": "biolink:Gene"}, {"object": "biolink:MolecularActivity", "predicate": "biolink:enables", "subject": "biolink:Gene"}, {"object": "biolink:CellularComponent", "predicate": "biolink:located_in", "subject": "biolink:Gene"}, {"object": "biolink:Disease", "predicate": "biolink:related_to", "subject": "biolink:Gene"}, {"object": "biolink:Gene", "predicate": "biolink:homologous_to", "subject": "biolink:Gene"}, {"object": "biolink:Gene", "predicate": "biolink:has_participant", "subject": "biolink:BiologicalProcess"}, {"object": "biolink:Gene", "predicate": "biolink:enabled_by", "subject": "biolink:MolecularActivity"}, {"object": "biolink:Gene", "predicate": "biolink:location_of", "subject": "biolink:CellularComponent"}, {"object": "biolink:Gene", "predicate": "biolink:related_to", "subject": "biolink:Disease"}] 51 | 52 | expect(response.body).toHaveProperty("edges"); > 53 | expect(response.body.edges).toEqual( | ^ 54 | expect.arrayContaining([ 55 | expect.objectContaining({ 56 | "subject": "biolink:SequenceVariant", at __test__/integration/TRAPIv1.1.test.js:53:45 at Object. (__test__/integration/TRAPIv1.1.test.js:43:9) ● Testing v1.1 endpoints › Query to Text Mining team Should return 200 with valid response expected 200 "OK", got 404 "Not Found" 66 | await request(app) 67 | .get("/v1/team/Text Mining Provider/meta_knowledge_graph") > 68 | .expect(200) | ^ 69 | .expect('Content-Type', /json/) 70 | .then((response) => { 71 | expect(response.body).toHaveProperty("nodes.biolink:Gene"); at Object. (__test__/integration/TRAPIv1.1.test.js:68:14) ---- at Test.Object..Test._assertStatus (../../../node_modules/supertest/lib/test.js:304:12) at ../../../node_modules/supertest/lib/test.js:80:15 at Test.Object..Test._assertFunction (../../../node_modules/supertest/lib/test.js:338:11) at Test.Object..Test.assert (../../../node_modules/supertest/lib/test.js:209:21) at Server.localAssert (../../../node_modules/supertest/lib/test.js:167:12) ● Testing v1.1 endpoints › GET /v1/smartapi/{smartapi_id}/meta_knowledge_graph expected 200 "OK", got 404 "Not Found" 99 | // testing with "Text Mining Targeted Association API" 100 | .get("/v1/smartapi/978fe380a147a8641caf72320862697b/meta_knowledge_graph") > 101 | .expect(200) | ^ 102 | .expect('Content-Type', /json/) 103 | .then((response) => { 104 | expect(response.body).toHaveProperty("nodes.biolink:Protein"); at Object. (__test__/integration/TRAPIv1.1.test.js:101:14) ---- at Test.Object..Test._assertStatus (../../../node_modules/supertest/lib/test.js:304:12) at ../../../node_modules/supertest/lib/test.js:80:15 at Test.Object..Test._assertFunction (../../../node_modules/supertest/lib/test.js:338:11) at Test.Object..Test.assert (../../../node_modules/supertest/lib/test.js:209:21) at Server.localAssert (../../../node_modules/supertest/lib/test.js:167:12) ● Testing v1.1 endpoints › POST /v1/query with gene2chemical query expect(received).toHaveProperty(path) Expected path: "NCBIGene:1017" Received path: [] Received value: {} 138 | expect(response.body.message.knowledge_graph).toHaveProperty("nodes"); 139 | expect(response.body.message.knowledge_graph).toHaveProperty("edges"); > 140 | expect(response.body.message.knowledge_graph.nodes).toHaveProperty("NCBIGene:1017") | ^ 141 | }) 142 | }) 143 | at __test__/integration/TRAPIv1.1.test.js:140:69 at Object. (__test__/integration/TRAPIv1.1.test.js:129:9) ● Testing v1.1 endpoints › POST /v1/query with disease2gene query expect(received).toHaveProperty(path) Expected path: "MONDO:0005737" Received path: [] Received value: {} 184 | expect(response.body.message.knowledge_graph).toHaveProperty("nodes"); 185 | expect(response.body.message.knowledge_graph).toHaveProperty("edges"); > 186 | expect(response.body.message.knowledge_graph.nodes).toHaveProperty("MONDO:0005737"); | ^ 187 | }) 188 | }) 189 | at __test__/integration/TRAPIv1.1.test.js:186:69 at Object. (__test__/integration/TRAPIv1.1.test.js:174:9) ● Testing v1.1 endpoints › POST /v1/query with query that doesn't provide input category expect(received).toHaveProperty(path) Expected path: "MONDO:0016575" Received path: [] Received value: {} 201 | expect(response.body.message.knowledge_graph).toHaveProperty("nodes"); 202 | expect(response.body.message.knowledge_graph).toHaveProperty("edges"); > 203 | expect(response.body.message.knowledge_graph.nodes).toHaveProperty("MONDO:0016575"); | ^ 204 | expect(response.body.message.knowledge_graph.nodes).toHaveProperty("NCBIGene:93"); 205 | expect(response.body.message.knowledge_graph.nodes["NCBIGene:93"]).toHaveProperty("categories", ["biolink:Gene"]); 206 | }) at __test__/integration/TRAPIv1.1.test.js:203:69 at Object. (__test__/integration/TRAPIv1.1.test.js:191:9) FAIL __test__/integration/routes/v1query_by_api.test.js (9.519 s) ● Testing /v1/smartapi/{smartapi_id}/query endpoints › Query to non-Text Mining KPs should have id resolution turned on expect(received).toContain(expected) // indexOf Expected value: "PUBCHEM.COMPOUND:5070" Received array: [] 87 | .expect('Content-Type', /json/) 88 | .then(response => { > 89 | expect(Object.keys(response.body.message.knowledge_graph.nodes)).toContain("PUBCHEM.COMPOUND:5070") | ^ 90 | }) 91 | }) 92 | at __test__/integration/routes/v1query_by_api.test.js:89:82 at Object. (__test__/integration/routes/v1query_by_api.test.js:82:9) Test Suites: 4 failed, 1 skipped, 9 passed, 13 of 14 total Tests: 16 failed, 14 skipped, 38 passed, 68 total Snapshots: 0 total Time: 10.066 s, estimated 26 s Ran all test suites. ```
colleenXu commented 2 years ago

tests haven't been failing for a week or so now. so closing

colleenXu commented 2 years ago

reopening since I see one failed test for call-apis:

FAIL test/integration/integration.test.js ● Integration test › Integration test using mygene.info gene to biological process association › check response

expect(received).toHaveLength(expected)

Expected length: 23
Received length: 28
colleenXu commented 2 years ago

With the new code push coming, these are the automated test errors I currently find

call-apis: the same error from my last post.

more info ``` ➜ call-apis git:(main) ✗ npm test > @biothings-explorer/call-apis@1.24.0 test > jest --env=node PASS __test__/logentry.test.js PASS __test__/query_bucket.test.js PASS __test__/query_queue.test.js PASS __test__/template_funcs.test.js PASS __test__/trapi_query_builder.test.js PASS __test__/query_builder.test.js PASS __test__/template_query_builder.test.js PASS __test__/query.test.js FAIL __test__/integration/integration.test.js ● Integration test › Integration test using mygene.info gene to biological process association › check response expect(received).toHaveLength(expected) Expected length: 23 Received length: 28 Received array: [{"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IBA", "publications": [Array], "term": "G1/S transition of mitotic cell cycle"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "NAS", "publications": [Array], "term": "G2/M transition of mitotic cell cycle"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IEA", "term": "negative regulation of transcription by RNA polymerase II"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "TAS", "publications": [Array], "term": "DNA replication"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IEA", "term": "DNA repair"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IBA", "publications": [Array], "term": "protein phosphorylation"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IDA", "publications": [Array], "term": "protein phosphorylation"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IMP", "publications": [Array], "term": "protein phosphorylation"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IEA", "term": "potassium ion transport"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IMP", "publications": [Array], "term": "centriole replication"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IBA", "publications": [Array], "term": "signal transduction"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IEP", "publications": [Array], "term": "Ras protein signal transduction"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IBA", "publications": [Array], "term": "positive regulation of cell population proliferation"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IDA", "publications": [Array], "term": "positive regulation of cell population proliferation"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IBA", "publications": [Array], "term": "regulation of G2/M transition of mitotic cell cycle"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IBA", "publications": [Array], "term": "regulation of gene expression"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IDA", "publications": [Array], "term": "histone phosphorylation"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IDA", "publications": [Array], "term": "peptidyl-serine phosphorylation"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IDA", "publications": [Array], "term": "positive regulation of heterochromatin assembly"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "TAS", "publications": [Array], "term": "mitotic G1 DNA damage checkpoint signaling"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IEA", "term": "positive regulation of DNA-dependent DNA replication initiation"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IEA", "term": "positive regulation of transcription, DNA-templated"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "TAS", "publications": [Array], "term": "centrosome duplication"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "IEA", "term": "cell division"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "TAS", "publications": [Array], "term": "meiotic cell cycle"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "TAS", "publications": [Array], "term": "cellular response to nitric oxide"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "TAS", "term": "cellular senescence"}, {"$edge_metadata": [Object], "$input": [Object], "$output": [Object], "evidence": "TAS", "term": "regulation of anaphase-promoting complex-dependent catabolic process"}] 15 | const query = new q([edge]); 16 | const res = await query.query(); > 17 | expect(res).toHaveLength(23); | ^ 18 | }) 19 | }) 20 | at Object. (__test__/integration/integration.test.js:17:25) Test Suites: 1 failed, 8 passed, 9 total Tests: 1 failed, 1 skipped, 72 passed, 74 total Snapshots: 0 total Time: 2.51 s, estimated 3 s ```
tokebe commented 2 years ago

Regarding the failing query_graph_handler test, it's not actually a specific test failing, rather the github actions step sending results to coveralls failing:

image

This error references a commit hash that does exist and shouldn't be invalid (in fact, the most recent commit whenever the workflow is run).

colleenXu commented 2 years ago

notes on current automated tests:

1 test fails in biomedical ID resolver, due to issue with node normalizer https://github.com/TranslatorSRI/NodeNormalization/issues/113

log of biomedical ID resolver test fail ``` FAIL __tests__/integration/sri_resolver.test.ts (63.668 s) ● Test SRI Resolver › Test unresolvable curie/bad input TypeError: Cannot read properties of undefined (reading '0') 133 | let uniqueInputs = [...new Set(originalInput[semanticType])]; 134 | uniqueInputs.forEach((curie) => { > 135 | let entry = result[curie][0]; | ^ 136 | if (!entry.semanticType) { 137 | entry._leafSemanticType = semanticType; 138 | entry.semanticType = semanticType; at src/sri.ts:135:32 at Array.forEach () at src/sri.ts:134:18 at Array.forEach () at mapInputSemanticTypes (src/sri.ts:127:30) at Object._resolveSRI (src/sri.ts:165:18) at Object.resolveSRI (src/index.ts:33:10) at Object. (__tests__/integration/sri_resolver.test.ts:28:17) Test Suites: 1 failed, 4 skipped, 7 passed, 8 of 12 total Tests: 1 failed, 64 skipped, 54 passed, 119 total Snapshots: 0 total Time: 65.444 s ```

--

api response transform: need to remove the cord transformer and its tests. These fail right now since this API was removed.

some logs related to cord api response transform ``` FAIL __test__/cord_transformer.test.js ● test cord transformer › test cord pairInputWithAPIResponse Network Error Test Suites: 1 failed, 1 skipped, 8 passed, 9 of 10 total Tests: 5 failed, 2 skipped, 38 passed, 45 total ```

call-apis: two tests fail. I think @tokebe has previously discussed why these tests fail...

some logs ``` FAIL __test__/integration/integration.test.js ● Integration test › Integration test using mygene.info gene to biological process association › check response expect(received).toHaveLength(expected) Expected length: 23 Received length: 0 Received array: [] 15 | const query = new q([edge]); 16 | const res = await query.query(); > 17 | expect(res).toHaveLength(23); | ^ 18 | }) 19 | }) 20 | at Object. (__test__/integration/integration.test.js:17:25) ● Integration test › Integration test using mydisease superclass_of › check response expect(received).toEqual(expected) // deep equality Expected: 39 Received: 0 62 | const res = await query.query(false); 63 | const mydisease_res = await axios.get("http://mydisease.info/v1/disease/MONDO:0002494?fields=mondo.descendants&dotfield=true"); > 64 | expect(res.length).toEqual(mydisease_res.data["mondo.descendants"].length) | ^ 65 | }) 66 | }) 67 | }) at Object. (__test__/integration/integration.test.js:64:32) PASS __test__/query.test.js Test Suites: 1 failed, 8 passed, 9 total Tests: 2 failed, 1 skipped, 71 passed, 74 total ```
colleenXu commented 2 years ago

tests are now all passing, closing this issue