Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Bugfixes (#50)
Browse files Browse the repository at this point in the history
- closes #48 - fixed incorrect API call endpoint
- closes #47 - added volume override for `/app/node_modules/`
- closes #49 - use `.env.secret` in tests; create `.env.secret` in GitHub tests from envvars
  • Loading branch information
mjaquiery authored Feb 27, 2023
1 parent 5be0842 commit 3da3d9b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
sudo smbget -R $LIIONSDEN_SMB_PATH/test-suite-small -U "$LIIONSDEN_SMB_USERNAME%$LIIONSDEN_SMB_PASSWORD"
- name: Build the stack
run: docker-compose -f docker-compose.test.yml build harvester
run: touch .env.secret && docker-compose -f docker-compose.test.yml build harvester

# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
Expand All @@ -57,8 +57,14 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up secrets
run: |
echo "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" > .env.secret
echo "DJANGO_SECRET_KEY=$DJANGO_SECRET_KEY" >> .env.secret
echo "DJANGO_TEST=$DJANGO_TEST" >> .env.secret
- name: Build the stack
run: touch .env.secret && docker-compose -f docker-compose.test.yml up -d --build app_test
run: docker-compose -f docker-compose.test.yml up -d --build app_test

# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
Expand Down
10 changes: 4 additions & 6 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ services:
command: -p 5433
volumes:
- "${GALVANALYSER_DATA_PATH}:/var/lib/postgresql/data"
environment:
POSTGRES_PASSWORD: "galvanalyser"
env_file:
- .env.secret
restart: unless-stopped

app_test:
Expand All @@ -27,10 +27,8 @@ services:
working_dir: /usr/app/backend_django
command: ../server.sh
# command: tail -F anything
environment:
POSTGRES_PASSWORD: "galvanalyser"
DJANGO_SECRET_KEY: "long-and-insecure-key-12345"
DJANGO_TEST: "TRUE"
env_file:
- .env.secret

harvester:
build:
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
- "80:80"
volumes:
- ./frontend:/app
- /app/node_modules/
working_dir: /app
env_file:
- ./.env
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/APIConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class APIConnection {

create_user(username: string, email: string, password: string): Promise<User> {
return fetch(
this.url + 'users/',
this.url + 'inactive_users/',
{
method: 'POST',
headers: {accept: 'application/json', 'content-type': 'application/json'},
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ export default function Login() {
To activate a user, log in to Galvanalyser as an active user and
select the appropriate inactive user from the 'users' tab on the left.
</Typography>
<Button
fullWidth
variant="contained"
color="primary"
className={classes.submit}
onClick={()=>window.location.reload()}
>
Log in with another account
</Button>
</Stack>

const formContent = <Fragment>
Expand Down

0 comments on commit 3da3d9b

Please sign in to comment.