Examples of CI/CD Testing Cycle on Real-life Projects

Arrow down icon
Published on
September 26, 2024
Boris Šijan
Published by
Boris Šijan
Subscribe To Our Newsletter - Bnkly X Webflow Template

Subscribe to our newsletter

Stay informed about the nearshoring and software engineering trends shaping the future of your industry.

Thanks for joining our newsletter
Oops! Something went wrong while submitting the form.
Sign me up

In the world of Agile, it is common that requirements and timelines frequently change because of client’s needs or perhaps because of what the market dictates. This is where Continuous Improvement (CI) proves to be essential by providing frequent, automated integration of code changes, which allows teams to detect and address issues early. This rapid feedback allows you to accommodate new requirements without disrupting the overall workflow.

Similarly, Continuous Deployment (CD) complements Agile by automating the release process, enabling code changes to be deployed to production quickly and reliably. This means that new features and updates can be delivered to users almost immediately.  

What is CI/CD? How to implement with different frameworks explained here.  

Read further to find out how we used CI/CD on different projects.  

What is the Test Pyramid and Why is it Important?

The Test Pyramid is a concept in software testing that emphasizes a balanced approach to different levels of testing to ensure efficiency and reliability. It’s called a pyramid because it visually represents the idea that you should have more low-level tests (like unit tests) than high-level tests (like end-to-end tests).

The importance of the Test Pyramid lies in its ability to create a balanced test suite that optimizes for speed, coverage, and reliability. By having many fast unit tests and fewer slow end-to-end tests, you ensure your CI/CD process is efficient and robust, catching issues early without slowing development.

RTM/Testlink to track requirements and tests

RTM (Requirements Traceability Matrix) and Testlink play a critical role in the CI/CD cycle by ensuring traceability and thorough testing throughout the software development lifecycle.  

RTM helps track the relationship between requirements and corresponding tests, and ensures that all requirements are covered, which reduces risk and maintains quality. Testlink, as a test management tool, links these tests to the requirements outlined in the RTM. When integrated into CI/CD, Testlink can automatically trigger tests whenever code changes occur, making sure that all requirements are met and functionality is intact at all times.

Specifics of testing Python code within a CI/CD cycle

Testing Python code within a CI/CD pipeline involves several considerations that ensure the reliability and efficiency of the development process.

A key part of this process is managing dependencies. Python projects often use many external libraries, so it's important to create isolated environments using tools like virtual environments or pipenv. This helps ensure the code behaves the same across development, testing, and production. Using frameworks like pytest or unittest allows developers to automate unit and integration tests, which makes it easier to catch bugs early.

Another crucial part is integrating tools like linters (e.g., flake8) and test coverage tools (e.g., coverage.py) into the CI/CD pipeline. These tools run automatically during the process to ensure code quality and proper test coverage. CI/CD platforms like Jenkins, GitHub Actions, or GitLab CI can automate testing.  

Examples of CI/CD on real-life projects

Basic application of CI/CD cycle on a project for knowledge management  

We used CI/CD testing for the development of our app Knowledge Maps which serves as a knowledge management tool and skill roadmap for our developers.

Read more about Knowledge Maps app, how it works and why it’s important for us here.

Read further to learn more about the CI/CD we used on this project.

The steps in the CI/CD process have greatly accelerated testing, database replication, and application deployment. The process starts with running the build script, followed by executing unit tests. Once they successfully pass, replication of a specific collection begins, depending on which environment we want to deploy to as the final goal. Based on the environment, we can trigger the next step after deployment, which is running integration and end-to-end (E2E) tests. Each step is dependent on the previous one, so if one step fails, the following steps are halted.

Many cloud services offer CI/CD integration, meaning that the implementation is much easier to integrate into projects within the same cloud environment. In our case, we didn’t have that, and the CI/CD script was entirely written for our on-premise internal server.

In terms of testing, the application didn’t need to be manually tested multiple times for the same feature, as automated tests were triggered with each new pull request (PR) or merge into a specific branch, as defined in the script.

One challenge was ensuring that all of this worked across the five environments we have, from development and testing to production.

The benefits are significant. The larger the project and team, the greater the benefits, as it saves time across the entire integration and deployment process, effectively replacing manual efforts with an automated script.

CI/CD testing on linear motion and robotics project

Also, CI/CD testing is used on our linear motion and robotics project with Ewellix.

Read more about the development of LIFTKIT and SLIDEKIT with Ewellix here.

Read more about developing one software solution for different robotic hands in a collaboration with Ewellix and Fanuc here.  

Before the CI/CD, the testing process was manual, slow and tedious. There were many steps to take in order to run a simple test. Because of this, the system was prone to errors.

By implementing CI/CD testing cycles, our software development testing process has received many benefits:

  • immediate feedback on code quality, allowing developers to catch and fix issues early in the development cycle;
  • codebase remains stable and that new changes don't introduce regressions or bug;
  • continuous integration and delivery, meaning faster release cycles without compromising on quality;
  • Improvement on team productivity since the automation of testing processes leaves more time to deal with complex tasks.  

Best Practices for Testing in the CI/CD Cycle

To ensure that testing is both effective and efficient in a CI/CD cycle, consider these best practices:

  • Writing tests before the actual development ensures that all features are covered from the start.
  • Automated tests should be triggered automatically with every code change, ensuring that no change goes untested.
  • Keep your test suite up-to-date with the latest features and changes in the codebase. Outdated tests can lead to false positives or negatives.
  • Regularly review the performance of your tests. Slow or flaky tests should be addressed promptly to maintain the efficiency of the CI/CD pipeline.
  • Ensure that tests run in isolated environments to avoid dependencies and side effects that could lead to inconsistent results.

Conclusion

To sum up, CI/CD ensures faster, high-quality releases, enhances productivity by automating routine tasks, and allows developers to focus on complex problems, ultimately driving continuous improvement across all stages of development. In this blog post, we also had the opportunity to see what CI/CD looks like in projects Englight Engineering works on.  

Feel free to contact us

Enlight logo