Skip to content

Commit

Permalink
removed config warning
Browse files Browse the repository at this point in the history
cleaned up test.yml workflow
try to run without .env files
  • Loading branch information
ulfgebhardt committed Apr 3, 2021
1 parent 1066f67 commit f6c070a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,10 @@ jobs:
##########################################################################
# UNIT TESTS BACKEND #####################################################
##########################################################################
# TODO: Why do we need those .envs?
- name: backend | copy env files webapp
run: cp webapp/.env.template webapp/.env
- name: backend | copy env files backend
run: cp backend/.env.template backend/.env
#- name: backend | copy env files webapp
# run: cp webapp/.env.template webapp/.env
#- name: backend | copy env files backend
# run: cp backend/.env.template backend/.env
- name: backend | docker-compose
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps neo4j backend
- name: backend | Initialize Database
Expand Down Expand Up @@ -232,13 +231,11 @@ jobs:
##########################################################################
# UNIT TESTS WEBAPP #####################################################
##########################################################################
# TODO: Why do we need those .envs?
- name: backend | copy env files webapp
run: cp webapp/.env.template webapp/.env
- name: backend | copy env files backend
run: cp backend/.env.template backend/.env
#- name: backend | copy env files webapp
# run: cp webapp/.env.template webapp/.env
#- name: backend | copy env files backend
# run: cp backend/.env.template backend/.env
- name: backend | docker-compose
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp
- name: webapp | Unit tests
#run: docker run --rm ocelotsocialnetwork/webapp:build yarn run test
run: docker-compose exec -T webapp yarn test
5 changes: 2 additions & 3 deletions backend/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ if (require.resolve) {
try {
dotenv.config({ path: require.resolve('../../.env') })
} catch (error) {
if (error.code === 'MODULE_NOT_FOUND') {
console.log('WARN: No `.env` file found in `/app` (docker) or `/backend` (no docker)') // eslint-disable-line no-console
} else {
// This error is thrown when the .env is not found
if (error.code !== 'MODULE_NOT_FOUND') {
throw error
}
}
Expand Down

0 comments on commit f6c070a

Please sign in to comment.