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

When using zenika/alpine-chrome:with-chromedriver docker image then in GitLab CI ChromeDriver was started successfully. is display but it get stuck and do nothing #245

Open
manishbupadhyay opened this issue Feb 29, 2024 · 9 comments
Labels

Comments

@manishbupadhyay
Copy link

Describe the bug
When using zenika/alpine-chrome:with-chromedriver docker image then in GitLab CI ChromeDriver was started successfully. is display but it get stuck and do nothing

To Reproduce
Steps to reproduce the behavior:

  1. Use zenika/alpine-chrome:with-chromedriver docker image in your docker and GitLab CI files

What is the expected behavior?
ChromeDriver was started successfully. and it should execute the test cases as well

What is the actual behavior?

Starting ChromeDriver 121.0.6167.184 (057a8ae7deb3374d0f1b04b36304d236f0136188-refs/branch-heads/6167@{#1818}) on port 9515

ChromeDriver was started successfully. is display but it get stuck and do nothing
image

@manishbupadhyay
Copy link
Author

Can someone please look into this and help me to resolve this issue?

As per my understanding I think zenika/alpine-chrome:with-chromedriver docker image starting chrome driver 121 but chrome has now new update 122 might be the chrome version issue.

@manishbupadhyay
Copy link
Author

@zigarn zigarn Can you please take a look at this?

@zigarn
Copy link
Contributor

zigarn commented Mar 1, 2024

@manishbupadhyay can you provide a minimal reproducible .gitlab-ci.yml file? Ideally even a public gitlab repository with it and the CI pipeline?

@zigarn
Copy link
Contributor

zigarn commented Mar 1, 2024

I'm only working on the packaging and don't know much of the JS frameworks packaged. But from what I understand, it's the expected behavior of the with-chromedriver image: it launch a chromedriver server and then wait for connections.
Ping @jlandure

@manishbupadhyay
Copy link
Author

manishbupadhyay commented Mar 1, 2024

Hey @zigarn thanks for your response, please find below minimal gitlab ci and docker files
.gitlab-ci.yml

image: internal/java-builder:17
variables:
  MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
  MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
  CONTEXT: ""
  ENVIRONMENT: ""
  APPLICATION_VERSION: ""
  CUCUMBER_TAGS:
    value: ""
    description: "The cucumber tag variable will pick tags from scheduled job, please pick ONE from this list: @SmokeTest,@GapMapsUI,@RegressionTest"

cache:
  paths:
    - .m2/repository/

stages:
  - build
  - SmokeTest
  - deploy

build:
  stage: build
  when: always
  script:
    - mvn compile
    - echo "Thanks for running $CI_JOB_NAME"

SmokeTest:
  stage: SmokeTest
  image: zenika/alpine-chrome:with-chromedriver
  artifacts:
    when: always
    paths:
      - target/
      - tests*
    #extends: .bootstrap-job-deb
    reports:
      junit:
        - target/surefire-reports/TEST-*.xml
        - target/failsafe-reports/TEST-*.xml
  rules:
    - if: '$CUCUMBER_TAGS == "@SmokeTest"'
      when: always
    - when: never

  script:
      - echo $MAVEN_CLI_OPTS
      - echo $MAVEN_OPTS
      - echo $CI_PROJECT_DIR
      - echo $CI_PROJECT_PATH
      - echo $CUCUMBER_TAGS
      - echo $CONTEXT
      - echo $ENVIRONMENT
      - echo $APPLICATION_VERSION
      - echo $CI_PIPELINE_SOURCE
      - echo $GITLAB_USER_LOGIN
      - mvn clean compile verify -Dcontext=$CONTEXT -Denvironment=$ENVIRONMENT -Dversion=$APPLICATION_VERSION -Djira.username=$GITLAB_USER_LOGIN -Dcucumber.filter.tags=$CUCUMBER_TAGS -Dit.test=SmokeTestRunner -Dwebdriver.remote.driver=chrome -Dwebdriver.remote.url=http://gitlabrunnerip:4444/wd/hub

deploy:
  stage: deploy
  environment: test
  when: on_success
  script:
    - echo "Thanks for deploying $CI_JOB_NAME"

docker file

FROM zenika/alpine-chrome:with-chromedriver
ADD ./target/myproject.jar app.jar
ARG test
ENV envValue=$test
ENTRYPOINT ["java","-jar","/app.jar"]

@zigarn
Copy link
Contributor

zigarn commented Mar 2, 2024

Please read https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#override-the-entrypoint-of-an-image
The image's entrypoint is used and as pointed in earlier comment, the entrypoint is to launch the chromedriver server.
So just reset the entrypoint in the gitlab-ci config:

#...
SmokeTest:
  stage: SmokeTest
  image:
    name: zenika/alpine-chrome:with-chromedriver
    entrypoint: [""]
#...

@manishbupadhyay
Copy link
Author

@zigarn when I use the entrypoint above as you mentioned then the mvn is not found message is displayed
#...
SmokeTest:
stage: SmokeTest
image:
name: zenika/alpine-chrome:with-chromedriver
entrypoint: [""]
#...

@zigarn
Copy link
Contributor

zigarn commented Mar 4, 2024

This is quite logic as neither java nor maven are provided in the image zenika/alpine-chrome:with-chromedriver.
You need to install them in your CI script or to extend the image first to add them in a new one containing chromedriver, java and maven.

@manishbupadhyay
Copy link
Author

@zigarn can you please give me an example with my above gitlab ci file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants