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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

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

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Microservices Testing: Key Strategies and Tools
  • Testcontainers: From Zero To Hero [Video]
  • Why Incorporate CI/CD Pipeline in Your SDLC?
  • The Most Popular Technologies for Java Microservices Right Now

Trending

  • Unlocking AI Coding Assistants Part 4: Generate Spring Boot Application
  • Unlocking the Benefits of a Private API in AWS API Gateway
  • Breaking Bottlenecks: Applying the Theory of Constraints to Software Development
  • Unlocking AI Coding Assistants Part 3: Generating Diagrams, Open API Specs, And Test Data
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. Handling Integration Tests In a CI Pipeline

Handling Integration Tests In a CI Pipeline

Take a look at the differences between integration and unit tests in a CI pipeline.

By 
David Guida user avatar
David Guida
·
Nov. 13, 19 · Review
Likes (3)
Comment
Save
Tweet
Share
13.2K Views

Join the DZone community and get the full member experience.

Join For Free

pipeline

Check out how integration tests play a role in CI pipelines.

Integration tests are a fundamental block of every project. And as such, they deserve a special treatment in the CI pipeline.

First of all, let’s make a clear distinction between unit and integration tests.

You may also enjoy:  From End to Beginning: Automation Testing in the CI/CD Pipeline

We discussed already this on my blog, but I would like to do a quick recap.

Unit tests are responsible of testing components in complete isolation. Dependencies have to be replaced with mocks and the whole test suite should take few seconds to run. If you have a unittest that takes more than 1-2 seconds, then you might want to take a deep look at the code. There are several good libraries for creating stubs and mocks available in every language. Personally, I use NSubstitute when I’m working in C#.

Integration tests are responsible for ensuring that the access to external systems works as expected. Database writes and reads, calls to APIs, and basically every I/O operation your application is performing.

Now, with Docker, it is relatively easy to set up a developer’s machine with something very similar to the production environment.

We can spin up databases and microservices with few configuration files and run the tests directly from our local machine.

But this is just the first step: once committed to the source code repository, we need to ensure that the code is always in good shape. Hence, we have to execute the tests also on whatever platform we’re using. This is one of the fundamental steps of Continuous Integration.

There are several options for Continuous Integration available online, all with pros and cons. CircleCI and Travis CI are just an example. They can connect to an existing repository and run the CI pipeline after every commit.

BitBucket and GitHub move a step further as they can also host your repositories so you can rely on just single platform.

I’ve been using GitLab instead for the last year in my daily job. It’s quite good…although sometimes I think that Swiss army knives are not the answer to everything.

In another article I’m going to show a very simple .NET Core application with Entity Framework 3 . We will also discuss how we can write integration tests that can run locally and as part of a CI pipeline.

Further Reading


Testing in CI

Continuous Integration/Deployment unit test Integration Pipeline (software) Database

Opinions expressed by DZone contributors are their own.

Related

  • Microservices Testing: Key Strategies and Tools
  • Testcontainers: From Zero To Hero [Video]
  • Why Incorporate CI/CD Pipeline in Your SDLC?
  • The Most Popular Technologies for Java Microservices Right Now

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!