See https://github.com/hipster-labs/jhipster-daily-builds
The daily builds for JDL Microservices + OAuth2 + Cypress are broken since days
entityName.json
files generated in the .jhipster
directoryI can take a look at this issue if no one is on it already. 😄
yes plz, @SudharakaP
Here some very quick analyze:
for JDLMs in GitHub Actions, the registry started at the same time than Keycloak, and Keycloak took approximatively 20sec to be "up", so the registry failed and is not up, so the other services can't start as the registry is not up
once, this 1st bug is fixed, Cypress can't access to Keycloak for unknown reason -> I manage to reproduce the issue locally. Maybe because cypress.json has "localhost:9080" hard coded, and here, we should use "keycloak:9080"
Easy to reproduce locally:
@pascalgrimaud : Interestingly enough I think we didn't used to run the e2e tests when things were passing before; for example; https://github.com/hipster-labs/jhipster-daily-builds/runs/1127373854?check_suite_focus=true. Although just switching to Protractor and running the e2e seems to fix the issue; which probably means I think this is a mis-configuration in Cypress.
Run with Protractor in my fork: https://github.com/SudharakaP/jhipster-daily-builds/runs/1227102969?check_suite_focus=true
@SudharakaP : yes, it's related to Cypress, as it works approximatively well with protractor (but with some random failures)
@pascalgrimaud @SudharakaP : I looked a little at each of them, we use a request to connect to keycloak with Cypress (keycloak commands here) and we use UI with Protractor (angular example). As @pascalgrimaud said, maybe we should use 'keycloak:9080' when it's needed.
We can save Cypress screenshots of the daily builds with something like this :
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: screenshots-${{ matrix.app-type }}
path: /home/runner/app/store/target/cypress/screenshots
@nassimerrahoui : Thanks for the tips. I tried changing the auth_base_url
to http://keycloak:9080/auth
but Cypress still wasn't able to connect I think. 🤔
same @SudharakaP
My tests locally :
@pascalgrimaud @nassimerrahoui : My guess is we are hitting this; https://github.com/cypress-io/cypress/issues/944
this build needs to be reactivated once it's fixed:https://github.com/jhipster/generator-jhipster/pull/12777
@SudharakaP are you working on this?
@mshima : I am, and was trying different things; but kinda out of ideas right now. 😢
EDIT: If you have any ideas or want to work on it please feel free to take it. 😄
An update.
I have tracked down the issue. And a fix is in the works.
Without application inside docker, keycloak is reached by localhost:9080 everywhere.
With docker:
keycload:9080
. So:Fixes:
@mshima : Thanks a lot for the detailed analysis. Seems like the daily builds are fixed. 👍🏼
After few days, your PR seems to fix the main problem, @mshima : good job !!!
There is still another problem, related to Registry, which doesn't start in time:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a9c537e00b26 postgres:13.0 "docker-entrypoint.s…" About a minute ago Up About a minute 5432/tcp docker-compose_crm-postgresql_1
56f9bab3f16c store "bash -c /entrypoint…" About a minute ago Up About a minute 0.0.0.0:8080->8080/tcp docker-compose_store_1
2bbeb9a8b64b jboss/keycloak:11.0.1 "/opt/jboss/tools/do…" About a minute ago Up About a minute 8080/tcp, 0.0.0.0:9080->9080/tcp, 0.0.0.0:9443->9443/tcp, 8443/tcp, 0.0.0.0:10990->10990/tcp docker-compose_keycloak_1
e59590f5068a docker.elastic.co/elasticsearch/elasticsearch:7.6.2 "/usr/local/bin/dock…" About a minute ago Up About a minute 9200/tcp, 9300/tcp docker-compose_crm-elasticsearch_1
10cafcb4b42e jhipster/jhipster-registry:v6.3.0 "/bin/sh -c 'java …" About a minute ago Exited (1) 41 seconds ago docker-compose_jhipster-registry_1
b36cc8e28d2d mariadb:10.5.6 "docker-entrypoint.s…" About a minute ago Up About a minute 127.0.0.1:3306->3306/tcp docker-compose_store-mariadb_1
3562320e87c1 crm "bash -c /entrypoint…" About a minute ago Up About a minute 5701/udp, 8081/tcp docker-compose_crm_1
I'm fixing this last part
@pascalgrimaud : I think this is done right? Maybe we can close this and I think @mshima should also claim the bounty. 😄
Indeed, we can close this.
@mshima can claim the bounty, but he never did it, I don't understand why :-)
Most helpful comment
An update.
I have tracked down the issue. And a fix is in the works.
Without application inside docker, keycloak is reached by localhost:9080 everywhere.
With docker:
keycload:9080
. So:1 - we need to update cypress.json with keycloak endpoint.
2 - once we update cypress.json we are affected by https://github.com/cypress-io/cypress/issues/944 like @SudharakaP suggested.
Fixes: