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

Fix CI build #524

Merged
merged 3 commits into from
Dec 13, 2024
Merged

Fix CI build #524

merged 3 commits into from
Dec 13, 2024

Conversation

mposolda
Copy link
Contributor

@mposolda mposolda commented Dec 12, 2024

closes #522

PR fixes CI. Summary of the changes:

  • Removed property -Dkeycloak.profile.feature.account2=disabled . This property is not used for anything in latest Keycloak nightly build as latest Keycloak supports just account3

  • Removed environment variables KEYCLOAK_ADMIN and KEYCLOAK_ADMIN_PASSWORD when starting the server. The variables are not needed as admin user is present anyway in the realm JSON file test/fixtures/auth-utils/nodejs-test-realm.json, which is used when importing the JSON file. When those environment variables are used, server fails to start due the DB constraint as there is an attempt to create admin user twice (I guess this check was not present in previous Keycloak server versions and hence it worked)

  • Updated Java to 21 for starting the server

  • Updating chromedriver to 131. Previous version of chromedriver was very old version 105, which does not work with latest Chrome and all the tests using chrome were failing. I've used command npm update chromedriver and all the related changes are done in the file package-lock.json (I am using separate commit for update chromedriver and all the changes in package-lock.json as it is huge amount of changes. But I can squash to same commit if it is preferred)

  • Updating node.js version in GH actions from 16 to 18. So now it is testing with 14 and 18. For some reason, the web tests did not worked with chromedriver with node 16. The newer version 18 works as well as older version 14 works fine. It might be an issue specific to node 16. Is it an issue to upgrade node version for testing? The node.js keycloak quickstart is using version 18 as well.

For the reference, here is the issue, which I saw in the CI with node 16:

------------------------------------
Running tests for file: test/keycloak-connect-web-enforcer-spec.js
------------------------------------

node:internal/modules/cjs/loader:1031
  throw err;
  ^

Error: Cannot find module 'chromedriver'
Require stack:
- /home/runner/work/keycloak-nodejs-connect/keycloak-nodejs-connect/test/utils/webdriver.js
- /home/runner/work/keycloak-nodejs-connect/keycloak-nodejs-connect/test/keycloak-connect-web-enforcer-spec.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
    at Function.Module._load (node:internal/modules/cjs/loader:873:27)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at determineChromedriverPath (/home/runner/work/keycloak-nodejs-connect/keycloak-nodejs-connect/test/utils/webdriver.js:59:26)
    at createDriver (/home/runner/work/keycloak-nodejs-connect/keycloak-nodejs-connect/test/utils/webdriver.js:28:54)
    at Object.<anonymous> (/home/runner/work/keycloak-nodejs-connect/keycloak-nodejs-connect/test/utils/webdriver.js:25:16)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/keycloak-nodejs-connect/keycloak-nodejs-connect/test/utils/webdriver.js',
    '/home/runner/work/keycloak-nodejs-connect/keycloak-nodejs-connect/test/keycloak-connect-web-enforcer-spec.js'
  ]
}
Error: Process completed with exit code 1.

@mposolda mposolda requested a review from jonkoops December 12, 2024 18:17
@mposolda mposolda changed the title 522 fix tests Fix CI build Dec 12, 2024
Signed-off-by: Jon Koops <[email protected]>
@jonkoops jonkoops merged commit 63dc614 into keycloak:main Dec 13, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI does not work in node.js repository
2 participants