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

[IT] Run integration tests only on changes in Flank and/or test projects #1337

Closed
piotradamczyk5 opened this issue Nov 19, 2020 · 0 comments · Fixed by #1344
Closed

[IT] Run integration tests only on changes in Flank and/or test projects #1337

piotradamczyk5 opened this issue Nov 19, 2020 · 0 comments · Fixed by #1344
Assignees

Comments

@piotradamczyk5
Copy link
Contributor

Author the user story for this feature

As a CI, I want to run integration tests only on changes in test_runner and test_projects so I can safe resources.

Describe the solution
We could use a path filter in integration tests.

@piotradamczyk5 piotradamczyk5 changed the title [IT] [IT] Run integration tests only on changes in Flank and/or test projects Nov 19, 2020
@pawelpasterz pawelpasterz self-assigned this Nov 24, 2020
piotradamczyk5 pushed a commit that referenced this issue Nov 24, 2020
Fixes #1337 

This PR adds step for IT workflow. It checks with `git diff` if any modified/removed/created/moved files were in `test_runner` and/or `integration_tests` directory.

## Test Plan
> How do we know the code works?

No straightforward way to do this. The added step is a simple bash script that sets output either to true or false.
To verify you can copy the script and run locally
```
git diff --name-only --diff-filter=AMDR HEAD^ HEAD > diffs.txt
echo "---------------"
cat diffs.txt
echo "---------------"
SHOULD_RUN='false'
while IFS= read -r file
do
  if [[ $file == test_runner/* ]] || [[ $file == integration_tests/* ]]; then
    SHOULD_RUN='true'
    break
  fi
done < diffs.txt
rm diffs.txt
echo "Should run IT: ${SHOULD_RUN}"
echo "::set-output name=should_run::${SHOULD_RUN}"
```

If case there are any files changed in `test_runner`/`integration_tests` `echo "::set-output name=should_run::true"` should be printed. Otherwise `echo "::set-output name=should_run::false"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants