Skip to content

Commit

Permalink
fix: file path, dependency, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Oct 20, 2023
1 parent f4f21b9 commit 023e530
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
8 changes: 4 additions & 4 deletions __test__/integration/TRAPIv1.1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ const arrEquals = (arr1, arr2) => {
};

describe("Testing v1.1 endpoints", () => {
const example_folder = path.resolve(__dirname, "../../examples/v1.1");
const clinical_risk_kp_folder = path.resolve(__dirname, "../../examples/v1.1/multiomics/clinical_risk_kp");
const old_spec_folder = path.resolve(__dirname, "../../examples/v0.9.2");
const invalid_example_folder = path.resolve(__dirname, "../../examples/v1.1/invalid");
const example_folder = path.resolve(__dirname, "../../../../examples/v1.1");
const clinical_risk_kp_folder = path.resolve(__dirname, "../../../../examples/v1.1/multiomics/clinical_risk_kp");
const old_spec_folder = path.resolve(__dirname, "../../../../examples/v0.9.2");
const invalid_example_folder = path.resolve(__dirname, "../../../../examples/v1.1/invalid");
const drug2disease_query = JSON.parse(
fs.readFileSync(path.join(clinical_risk_kp_folder, "query_drug_to_disease.json")),
);
Expand Down
8 changes: 4 additions & 4 deletions __test__/integration/TRAPIv1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ var path = require('path');

//V1 tests are now skipped.
describe.skip("Testing v1 endpoints", () => {
const example_folder = path.resolve(__dirname, '../../examples/v1');
const clinical_risk_kp_folder = path.resolve(__dirname, '../../examples/v1/multiomics/clinical_risk_kp');
const old_spec_folder = path.resolve(__dirname, "../../examples/v0.9.2");
const invalid_example_folder = path.resolve(__dirname, "../../examples/v1/invalid");
const example_folder = path.resolve(__dirname, '../../../../examples/v1');
const clinical_risk_kp_folder = path.resolve(__dirname, '../../../../examples/v1/multiomics/clinical_risk_kp');
const old_spec_folder = path.resolve(__dirname, "../../../../examples/v0.9.2");
const invalid_example_folder = path.resolve(__dirname, "../../../../examples/v1/invalid");
const drug2disease_query = JSON.parse(fs.readFileSync(path.join(clinical_risk_kp_folder, 'query_drug_to_disease.json')));
const gene2chemical_query = JSON.parse(fs.readFileSync(path.join(example_folder, 'query_chemicals_physically_interacts_with_genes.json')));
const disease2gene_query = JSON.parse(fs.readFileSync(path.join(example_folder, 'query_genes_relate_to_disease.json')));
Expand Down
4 changes: 2 additions & 2 deletions __test__/integration/routes/v1query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ var path = require("path");

// Reason: Takes too long as predict, missing smartapi.yaml for validation
describe("Testing /v1/query endpoints", () => {
const invalid_example_folder = path.resolve(__dirname, "../../../examples/v1.1/invalid");
const example_folder = path.resolve(__dirname, "../../../examples/v1.1");
const invalid_example_folder = path.resolve(__dirname, "../../../../../examples/v1.1/invalid");
const example_folder = path.resolve(__dirname, "../../../../../examples/v1.1");
test("Input query graph that doesn't pass Swagger Validation should return 400 error", async () => {
const InvalidInputQueryGraph = {
message1: 1,
Expand Down
4 changes: 2 additions & 2 deletions __test__/integration/routes/v1query_by_api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const og_axios = jest.requireActual("axios");
jest.mock("axios");

describe("Testing /v1/smartapi/{smartapi_id}/query endpoints", () => {
const invalid_example_folder = path.resolve(__dirname, "../../../examples/v1.1/invalid");
const example_folder = path.resolve(__dirname, "../../../examples/v1.1");
const invalid_example_folder = path.resolve(__dirname, "../../../../../examples/v1.1/invalid");
const example_folder = path.resolve(__dirname, "../../../../../examples/v1.1");
test("Input query graph that doesn't pass Swagger Validation should return 400 error", async () => {
const InvalidInputQueryGraph = {
message1: 1,
Expand Down
4 changes: 2 additions & 2 deletions __test__/integration/routes/v1query_by_team.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const axios = require("axios");
var path = require("path");

describe("Testing /v1/team/{team_name}/query endpoints", () => {
const invalid_example_folder = path.resolve(__dirname, "../../../examples/v1.1/invalid");
const example_folder = path.resolve(__dirname, "../../../examples/v1.1");
const invalid_example_folder = path.resolve(__dirname, "../../../../../examples/v1.1/invalid");
const example_folder = path.resolve(__dirname, "../../../../../examples/v1.1");
test("Input query graph that doesn't pass Swagger Validation should return 400 error", async () => {
const InvalidInputQueryGraph = {
message1: 1,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"dependencies": {
"@biothings-explorer/query_graph_handler": "file:../query_graph_handler",
"@biothings-explorer/smartapi-kg": "file:../smartapi-kg",
"@bull-board/api": "^5.9.1",
"@bull-board/express": "^5.9.1",
"@sentry/node": "^7.74.1",
"@sentry/profiling-node": "^1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/routes/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class RoutePerformance {
.route("/performance")
.get((req, res) => {
debug("start to retrieve performance log.");
const file_path = path.resolve(__dirname, "../../performance-test/report.html");
const file_path = path.resolve(__dirname, "../../../../performance-test/report.html");
debug(`file path is ${file_path}`);
try {
fs.access(file_path, fs.constants.R_OK, err => {
Expand Down

0 comments on commit 023e530

Please sign in to comment.