diff --git a/.env.dev b/.env.dev index 0b87b92..f651fc3 100644 --- a/.env.dev +++ b/.env.dev @@ -6,3 +6,8 @@ NUXT_URL_P2M2_API_PARSE="http://localhost:8080/p2m2tools/api/format/parse/" NUXT_URL_P2M2_API_SNIF="http://localhost:8080/p2m2tools/api/format/sniffer" NUXT_PATH_SHARE="./shareFile" +PGHOST="localhost" +PGPASSWORD="ep2m2" +PGUSER="ep2m2" +PGPORT="5432" +PGDATABASE="ep2m2db" \ No newline at end of file diff --git a/README.md b/README.md index 91824c3..ce3765d 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,23 @@ metabolomic target analyzes manager. - Associated calibration curves ## Installation + +### Manual installation + +```bash +npm i +``` + +### Running tests + +```bash +docker volume prune +## database and API +docker compose --env-file .env.test -f compose.dev.yaml up -d + +rpm run test +``` + ### Docker compose (Recommended) _Requirement_ : Docker Engine 1. Download release archive diff --git a/compose.dev.yaml b/compose.dev.yaml index ddbc6c2..c580503 100644 --- a/compose.dev.yaml +++ b/compose.dev.yaml @@ -19,8 +19,12 @@ services: - "5432:5432" volumes: - ./db/init.sql:/docker-entrypoint-initdb.d/init.sql - env_file: - - ./secrets/pg.env + environment: + POSTGRES_PASSWORD: ${PGPASSWORD} + POSTGRES_USER: ${PGUSER} + POSTGRES_DB: ${PGDATABASE} + PGPORT: ${PGPORT} + PGHOST: ${PGHOST} volumes: shareFile: diff --git a/compose.test.yaml b/compose.test.yaml index 8c9cf35..45b7e54 100644 --- a/compose.test.yaml +++ b/compose.test.yaml @@ -2,24 +2,7 @@ # # SPDX-License-Identifier: MIT -services: - web: - build: - context: . - dockerfile: Dockerfile.test - container_name: ep2m2_web - ports: - - "80:3000" - volumes: - - shareFile:/shareFile - - /home/runner/work/EP2M2/EP2M2/test:/EP2M2/test - environment: - PGPASSWORD: ep2m2 - PGUSER: ep2m2 - PGPORT: 5432 - PGDATABASE: ep2m2db - - +services: api: image: inraep2m2/service-p2m2tools-api:latest container_name: p2m2ToolsApi diff --git a/test/server/tableClass.test.ts b/test/server/tableClass.test.ts index 27e337f..ffee694 100644 --- a/test/server/tableClass.test.ts +++ b/test/server/tableClass.test.ts @@ -16,25 +16,4 @@ describe("tableClass", async ()=>{ expect(await(new Table("unknow"))).toThrowError(/^unknow table doesn't exist$/); }); - // Define structure of compound table - const compound:{columnName:string, type:string, maxLength:number|null}[] = [ - {columnName:"id", type:"integer", maxLength:null}, - {columnName:"name", type:"character varying", maxLength:255}, - {columnName:"url", type:"character varying", maxLength:255}, - {columnName:"description", type:"text", maxLength:null}, - {columnName:"archive_date", type:"timestamp with time zone", - maxLength:null}, - ]; - const compTable = await (new Table("compound")); - const compHeader = compTable.header; - - test("Check number of header without id", ()=>{ - expect(compHeader.length).toBe(compound.length - 1); - }); - - - test("getHearder", () => { - - }); - }); \ No newline at end of file