Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the integration tests only when needed #690

Merged
merged 3 commits into from
Aug 4, 2023
Merged

Conversation

lslezak
Copy link
Contributor

@lslezak lslezak commented Aug 4, 2023

Problem

  • Running the integration tests in the CI always is quite expensive, usually they take 8-10 minutes
  • There are many cases when running integration tests is not needed and it just wastes resources and you need to wait longer before merging a pull request

Some examples when the integration tests should be skipped (if only these components are updated):

  • Updating the command line interface
  • Updating a README file or any documentation files
  • Updating an unit test
  • Updating examples
  • Updating *.spec or *.changes files

Note

We also run the CI after any commit to a branch. Which means it can also help in this scenario:

  • You create a branch and commit a code fix there
  • Later you find out that an unit test fails
  • You fix the unit test in another commit

The integration tests will run for the first commit but not for the second. When you create a pull request from that branch both integration and unit tests will run.

Solution

  • Use path matching and run the integration tests only when a file relevant for the integration tests is updated
  • The path list is not set in stone, we will need to adapt it if some files a removed or new ones are added.

Use path patterns in the GutHub Action to set when they should be started
@coveralls
Copy link

coveralls commented Aug 4, 2023

Coverage Status

coverage: 72.158%. remained the same when pulling f127e0d on integration_test_runs into 9c7a6ad on master.

.github/workflows/ci-integration-tests.yml Show resolved Hide resolved
.github/workflows/ci-integration-tests.yml Outdated Show resolved Hide resolved
Co-authored-by: Imobach González Sosa <igonzalezsosa@suse.com>
@lslezak lslezak merged commit d0834ac into master Aug 4, 2023
14 checks passed
@lslezak lslezak deleted the integration_test_runs branch August 4, 2023 13:09
@imobachgs imobachgs mentioned this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants