diff --git a/dev/config/test_backend_next/.env b/dev/config/test_backend_next/.env new file mode 100644 index 0000000..426b9bf --- /dev/null +++ b/dev/config/test_backend_next/.env @@ -0,0 +1,17 @@ +MONGODB_URI=mongodb://mongodb:27017/test_be_next +PID_PREFIX="API_testing" +ADMIN_GROUPS="admin,adminingestor" +DELETE_GROUPS="archivemanager" +CREATE_DATASET_GROUPS=group1,group2,group3 +CREATE_DATASET_WITH_PID_GROUPS="group2" +CREATE_DATASET_PRIVILEGED_GROUPS="datasetingestor,group3" +CREATE_JOB_GROUPS=group1,group2 +UPDATE_JOB_GROUPS=group1 +DELETE_JOB_GROUPS="archivemanager" +PROPOSAL_GROUPS="proposalingestor" +SAMPLE_PRIVILEGED_GROUPS="sampleingestor" +SAMPLE_GROUPS="group1" +MONGODB_COLLECTION=Dataset +STACK_VERSION=8.8.2 +MEM_LIMIT=4G +JOB_CONFIGURATION_FILE="test/config/jobconfig.json" diff --git a/dev/config/test_backend_next/jobconfig.json b/dev/config/test_backend_next/jobconfig.json new file mode 100644 index 0000000..807d901 --- /dev/null +++ b/dev/config/test_backend_next/jobconfig.json @@ -0,0 +1,87 @@ +{ + "configVersion": "v1.0 2024-03-01 6f3f38", + "jobs": [ + { + "jobType": "all_access", + "configVersion": "v1.0 2024-03-01 6f3f38", + "create": { + "auth": "#all", + "actions": [ + { + "actionType": "log" + }, + { + "actionType": "url", + "url": "http://localhost:3000/api/v3/health?jobid={{id}}", + "headers": { + "accept": "application/json" + } + } + ] + }, + "statusUpdate": { + "auth": "#all" + } + }, + { + "jobType": "public_access", + "configVersion": "v1.0 2024-03-01 6f3f31", + "create": { + "auth": "#datasetPublic" + }, + "statusUpdate": { + "auth": "#all" + } + }, + { + "jobType": "authenticated_access", + "configVersion": "v1.0 2024-03-01 6f3f32", + "create": { + "auth": "#authenticated" + }, + "statusUpdate": { + "auth": "#all" + } + }, + { + "jobType": "dataset_access", + "configVersion": "v1.0 2024-03-01 6f3f33", + "create": { + "auth": "#datasetAccess" + }, + "statusUpdate": { + "auth": "#jobOwnerGroup" + } + }, + { + "jobType": "owner_access", + "configVersion": "v1.0 2024-03-01 6f3f34", + "create": { + "auth": "#datasetOwner" + }, + "statusUpdate": { + "auth": "#jobOwnerUser" + } + }, + { + "jobType": "user_access", + "configVersion": "v1.0 2024-03-01 6f3f35", + "create": { + "auth": "user5.1" + }, + "statusUpdate": { + "auth": "user5.1" + } + }, + { + "jobType": "group_access", + "configVersion": "v1.0 2024-03-01 6f3f36", + "create": { + "auth": "@group5" + }, + "statusUpdate": { + "auth": "@group5" + } + } + ] +} diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index 2fb6a33..f20b8a7 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -8,6 +8,7 @@ services: profiles: - be - be_next + - test_be_next - oi mongodb_seed: @@ -77,21 +78,36 @@ services: profiles: - fe - be_next: + be_next_base: build: context: ../scicat-backend-next/. target: dev - depends_on: - - mongodb ports: - 3000:3000 volumes: - ../scicat-backend-next:/home/node/app - /home/node/app/node_modules - /home/node/app/dist - - ../scicat-backend-next/functionalAccounts.json.minimal.example:home/node/app/functionalAccounts.json + - ../scicat-backend-next/functionalAccounts.json.test:/home/node/app/functionalAccounts.json env_file: ./config/backend_next/.env command: /bin/sh -c "while true; do sleep 600; done" + profiles: + - never + + test_be_next: + extends: be_next_base + depends_on: + - mongodb + volumes: + - ./config/test_backend_next/jobconfig.json:/home/node/app/test/config/jobconfig.json + env_file: ./config/test_backend_next/.env + profiles: + - test_be_next + + be_next: + extends: be_next_base + depends_on: + - mongodb profiles: - be_next