Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include v4 api:mocha tests in dev setup #358

Merged
merged 7 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions services/backend/services/v4/compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ services:
volumes:
- v4_dev:/home/node/app
- ${PWD}/entrypoints/setup_git.sh:/docker-entrypoints/2.sh
- ./config/functionalAccounts.dev.json:/home/node/app/functionalAccounts.json
- ./entrypoints/tests.sh:/docker-entrypoints/3.sh
env_file:
- ./config/.dev.env
healthcheck:
retries: 20
interval: 1m

volumes:
v4_dev:
Expand Down
11 changes: 11 additions & 0 deletions services/backend/services/v4/config/.dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
MONGODB_URI=mongodb://mongodb:27017/dev_be_next
ADMIN_GROUPS=admin,adminingestor
CREATE_DATASET_GROUPS=group1,group2,group3
CREATE_DATASET_WITH_PID_GROUPS=group2
CREATE_DATASET_PRIVILEGED_GROUPS=datasetIngestor,group3
SAMPLE_PRIVILEGED_GROUPS=sampleingestor
SAMPLE_GROUPS=group1
DATASET_CREATION_VALIDATION_ENABLED=true
DATASET_CREATION_VALIDATION_REGEX=^scicatlive_testing/[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$
PID_PREFIX=scicatlive_testing
SITE=PSI
2 changes: 1 addition & 1 deletion services/backend/services/v4/config/.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ JWT_SECRET=secret
EXPRESS_SESSION_SECRET=secret

ADMIN_GROUPS=admin
DELETE_GROUPS=buggy
DELETE_GROUPS=archivemanager
CREATE_DATASET_GROUPS=ingestor
PROPOSAL_GROUPS=proposalingestor
SAMPLE_GROUPS=ingestor
93 changes: 93 additions & 0 deletions services/backend/services/v4/config/functionalAccounts.dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
[
{
"username": "admin",
"email": "scicatadmin@your.site",
"password": "2jf70TPNZsS",
"role": "admin",
"global": true
},
{
"username": "adminIngestor",
"email": "adminingestor@scicat.project",
"password": "13f4242dc691a3ee3bb5ca2006edcdf7",
"role": "adminingestor",
"global": false
},
{
"username": "ingestor",
"password": "aman",
"email": "scicatingestor@your.site",
"role": "ingestor",
"global": false
},
{
"username": "archiveManager",
"email": "scicatarchivemanager@your.site",
"password": "aman",
"role": "archivemanager",
"global": false
},
{
"username": "datasetIngestor",
"email": "datasetingestor@scicat.project",
"password": "bc35db76848cf9fbb7f40b6661644e97",
"role": "datasetingestor",
"global": false
},
{
"username": "proposalIngestor",
"email": "scicatproposalingestor@your.site",
"password": "aman",
"role": "proposalingestor",
"global": false
},
{
"username": "sampleIngestor",
"email": "sampleingestor@scicat.project",
"password": "e4876cb39c7dc4fe957d7c4f6a34cdd8",
"role": "sampleingestor",
"global": false
},
{
"username": "user1",
"email": "user1@your.site",
"password": "a609316768619f154ef58db4d847b75e",
"role": "group1",
"global": false
},
{
"username": "user2",
"email": "user2@your.site",
"password": "f522d1d715970073a6413474ca0e0f63",
"role": "group2",
"global": false
},
{
"username": "user3",
"email": "user3@your.site",
"password": "70dc489e8ee823ae815e18d664424df2",
"role": "group3",
"global": false
},
{
"username": "user4",
"email": "user4@your.site",
"password": "0014890e7020f515b92b767227ef2dfa",
"role": "group4",
"global": false
},
{
"username": "user5.1",
"email": "user5.1@your.site",
"password": "359a5fda99bfe5dbc42ee9b3ede77fb7",
"role": "group5",
"global": false
},
{
"username": "user5.2",
"email": "user5.2@your.site",
"password": "f3ebd2e4def95db59ef95ee32ef45242",
"role": "group5",
"global": false
}
]
7 changes: 7 additions & 0 deletions services/backend/services/v4/entrypoints/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@
## Setting the --runInBand makes the tests run sequentially,
## avoiding to fill the RAM which makes them freeze
npm run test -- --runInBand

npm start &
PID="${!}"
sleep 30
npm run test:api:mocha

kill "${PID}"