alpine-chrome icon indicating copy to clipboard operation
alpine-chrome copied to clipboard

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

Open manishbupadhyay opened this issue 1 year ago • 9 comments

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 avatar Feb 29 '24 04:02 manishbupadhyay

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 avatar Feb 29 '24 04:02 manishbupadhyay

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

manishbupadhyay avatar Mar 01 '24 02:03 manishbupadhyay

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

zigarn avatar Mar 01 '24 04:03 zigarn

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

zigarn avatar Mar 01 '24 04:03 zigarn

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"]

manishbupadhyay avatar Mar 01 '24 11:03 manishbupadhyay

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: [""]
#...

zigarn avatar Mar 02 '24 10:03 zigarn

@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: [""] #...

manishbupadhyay avatar Mar 04 '24 02:03 manishbupadhyay

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.

zigarn avatar Mar 04 '24 06:03 zigarn

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

manishbupadhyay avatar Mar 04 '24 07:03 manishbupadhyay