DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. View Squish Test Results of Merge Requests in GitLab

View Squish Test Results of Merge Requests in GitLab

Testing is always easier when it can be directly integrated. Take a look at this demonstration of how to use Merge with GitLab

Tomasz Pawlowski user avatar by
Tomasz Pawlowski
·
Oct. 22, 18 · Analysis
Like (1)
Save
Tweet
Share
3.06K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

It’s very important to make automated GUI tests a part of a Continuous Integration (CI) process. Squish offers add-ons for many popular CI tools like Jenkins, Bamboo, and TeamCity. The full list is here. If your tool is not on the list, it can be still integrated as Squish tests because we support a command-line interface for all of our tools. Moreover, Squish can generate JUnit reports, which can be parsed easily by many CI or Test Management tools.

GitLab

This article demonstrates how to run Squish tests on merge requests in GitLab. Squish will generate a JUnit report and we will configure a job in GitLab to use this report. Later GitLab will display a test summary on the merge request page. It contains information about newly failed tests, existing failures and resolved failures. Based on the above data, a decision about merge is made.

Runner Settings

The first step is to configure GitLab Runner. We will configure the following environment variables:

  • SQUISH_DIR – Squish Installation directory
  • SQUISH_LICENSEKEY_DIR – Squish license location
  • SQUISH_SERVER_PORT – port at which squishserver process is started
  • DISPLAY – display used to display an application GUI. We use VNC Server to provide a headless display

Job Configuration

The next step is to define a pipeline in .gitlab-ci.yml file. Pipelines are defined by specifying jobs that run in stages. In our example, we define job named “squish-tests1” which is run in a test stage.


squish-tests1:
    stage: test
    script: 
    - echo DISPLAY=$DISPLAY
    - echo $SQUISH_DIR
    - echo "Starting squishserver..."
    - $SQUISH_DIR/bin/squishserver --port $SQUISH_SERVER_PORT 1>server.log 2>&1 &
    - sleep 5
    - echo "Register AUT..."
    - $SQUISH_DIR/bin/squishserver --port $SQUISH_SERVER_PORT --config addAUT addressbook /home/name/Squish/squish-for-qt-6.4.0/examples/qt/addressbook
    - $SQUISH_DIR/bin/squishrunner --port $SQUISH_SERVER_PORT --testsuite tests/suite_addressbook --reportgen junit,report.xml --reportgen stdout
    - echo "Stopping squishserver..."
    - $SQUISH_DIR/bin/squishserver --stop --port $SQUISH_SERVER_PORT &
    artifacts:
       reports: 
          junit: report.xml
       paths:
         - server.log


The job performs the following actions:

  1. Start squishserver and redirect its stdout and stderr output to a server.log file
  2. Register the Application Under Test (AUT)
  3. Call squishrunner to run the Test Suite and generate JUnit report and stdout report (so results are also printed to a screen)
  4. Stop squishserver
  5. Collect artifacts

Use Case

While working on a dev branch, we introduced a defect that is causing a failure in a test case. When committing a change, Squish Tests are executed.


Later in GitLab, we create a merge request to the master branch. On the Merge Request Page, a Test Summary shows a difference between test results on the master versus the merged branch.


In the picture above, a Test Summary shows that there is one new failed test. Based on this information, a decision about the merge can be made.

Testing Squish (Froglogic) Merge (version control) GitLab Requests Continuous Integration/Deployment

Published at DZone with permission of Tomasz Pawlowski. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • TDD: From Katas to Production Code
  • Automated Performance Testing With ArgoCD and Iter8
  • 13 Code Quality Metrics That You Must Track
  • Using AI and Machine Learning To Create Software

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: