Wait on SAML login to be ready#3569
Merged
Merged
Conversation
humphd
previously approved these changes
Apr 29, 2022
humphd
left a comment
Contributor
There was a problem hiding this comment.
Interesting. I wonder if we should switch to a maintained version (there are a bunch of forks, https://github.com/kenchan0130/docker-simplesamlphp for example).
Contributor
|
This is failing the same way as my PR in Vercel: |
Contributor
Author
|
humphd
requested changes
Apr 30, 2022
humphd
left a comment
Contributor
There was a problem hiding this comment.
This is interesting, CI failing:
Run pnpm db:migrate
> @senecacdot/telescope@3.0.4 db:migrate /home/runner/work/telescope/telescope
> prisma migrate dev --schema=src/db/prisma/schema.prisma && prisma generate --schema=src/db/prisma/schema.prisma
Prisma schema loaded from src/db/prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "localhost:5432"
Error: P[10](https://github.com/Seneca-CDOT/telescope/runs/6242093737?check_suite_focus=true#step:10:10)01: Can't reach database server at `localhost`:`5432`
Please make sure your database server is running at `localhost`:`5432`.
I think we need to add a dedicated step to the CI jobs that waits on the db to become ready before we: a) migrate; or b) run e2e tests. We could so something like:
steps:
# Pull, build, and run containers, then start e2e tests
- run: pnpm install
- name: Pull/Build Docker Containers Necessary for Running E2E Tests
run: docker compose --env-file ./config/env.development up -d ${{ env.DOCKER_CONTAINERS }}
- name: Wait for Postgres and Login containers to become fully ready
run: pnpx -y wait-on tcp:5432 http://localhost:8081/simplesaml
- name: Apply database migrations
run: pnpm db:migrate
- run: pnpm jest:e2e
humphd
previously approved these changes
May 2, 2022
| @@ -1,34 +1,14 @@ | |||
| // eslint-disable-next-line | |||
| const { waitForPostgres } = require('@jcoreio/wait-for-postgres'); | |||
Contributor
There was a problem hiding this comment.
Can we remove this dependency now then?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wait for
logincontainer to be ready.
Fix #3504
I can reproduce this e2e test failure consistently locally by running the e2e test right after spinning up the containers. So one of the containers must be not ready and make the test fail.
In #3504, following my suggestion, @humphd has tried to debug the
test-web-containerbut found nothing suspicious.I now realized it's the
loginortest-samlcontainer that's not ready for tests.I couldn't figure out why it takes so long to start up. The repo of the container itself has not been maintained for 4 years https://github.com/kristophjunge/docker-test-saml-idp.
For now, we can wait for the container to be ready before running tests.
Here's the log of the container.