Commit e27144ac authored by Nikos Psaromanolakis's avatar Nikos Psaromanolakis
Browse files

back to old version with minor fixes

parent 7c6abeb2
Loading
Loading
Loading
Loading
Loading
+39 −25
Changes for .gitlab-ci.yml: 39 added lines, 25 removed lines.
Original line number Diff line number Diff line
stages:
  - test

# Maven image with JDK.
image: maven:3.9-eclipse-temurin-17

variables:
  MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
  # Default karate env if not set by job/rule
  KARATE_ENV: "dev-etsi"

cache:
@@ -15,12 +18,20 @@ cache:
  stage: test
  timeout: 30 minutes
  tags:
    - openslice-1.plugtests.net
    - hypo
  before_script:
    - mvn -version
    - mvn -q validate
    - mvn -q test-compile
    - mvn -q test "-Dkarate.options=--dryrun"
    - apt-get update -qq
    - apt-get install -y -qq chromium-browser xvfb
    # Start virtual display
    - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
    - sleep 2
  script:
    #  KARATE_OPTIONS injected by each job
    - mvn test -Dkarate.env="$KARATE_ENV" "-Dkarate.options=$KARATE_OPTIONS"
  artifacts:
    when: always
    expire_in: 14 days
@@ -31,54 +42,57 @@ cache:
      junit:
        - target/surefire-reports/TEST-*.xml

# Portal E2E Test (uses Selenium Docker image)
orchestrator_portal:
  image: selenium/standalone-chrome:latest
# 1) Smoke on Merge Requests
smoke:
  extends: .karate_test_template
  variables:
    KARATE_OPTIONS: "--tags @portal-login-test"
  script:
    - mvn test -Dkarate.env="$KARATE_ENV" "-Dkarate.options=$KARATE_OPTIONS"
    KARATE_OPTIONS: "--tags @smoke-auth"
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
      when: on_success
    - when: never

# Private Orchestrator
orchestrator_private:
# 2) Full regression on main branch
regression_main:
  extends: .karate_test_template
  variables:
    KARATE_OPTIONS: "--tags @smoke-e2e-workflow-private" 
  script:
    - mvn test -Dkarate.env="$KARATE_ENV" "-Dkarate.options=$KARATE_OPTIONS"
  needs: ["orchestrator_portal"]
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
    - if: '$CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push"'
      when: on_success
    - when: never

# Public Orchestrator
orchestrator_public:
# 3) Nightly regression (run only via GitLab Schedules) ->Should create a Schedule in GitLab UI and set variable: KARATE_ENV=stage (recommended)
nightly_regression:
  extends: .karate_test_template
  variables:
    KARATE_OPTIONS: "--tags @smoke-e2e-workflow-public"
  script:
    - mvn test -Dkarate.env="$KARATE_ENV" "-Dkarate.options=$KARATE_OPTIONS"
  needs: ["orchestrator_private"]
    KARATE_OPTIONS: "--tags @smoke-e2e-workflow-private"  
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
      when: on_success
    - when: never

# OCM Orchestrator
orchestrator_ocm:

# 4) Full regression on this branch
regression_portal:
  extends: .karate_test_template
  variables:
    KARATE_OPTIONS: "--tags @portal-login-test" 


  image: selenium/standalone-chrome:latest
  extends: .karate_test_template
  variables:
    KARATE_OPTIONS: "--tags @smoke-e2e-workflow-ocm"
    KARATE_OPTIONS: "--tags @portal-login-test"
  before_script:
    - apt-get update -qq && apt-get install -y -qq maven openjdk-17-jdk
    - mvn -version
    - mvn -q validate
    - mvn -q test-compile
    - mvn -q test "-Dkarate.options=--dryrun"
  script:
    - mvn test -Dkarate.env="$KARATE_ENV" "-Dkarate.options=$KARATE_OPTIONS"
  needs: ["orchestrator_public"]
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
    - if: '$CI_COMMIT_BRANCH == "portal-and-stress-test" && $CI_PIPELINE_SOURCE == "push"'
      when: on_success
    - when: never
 No newline at end of file