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

SNOW-1482571: Add CI pipeline for apps unit testing #3

Merged
merged 69 commits into from
Jun 19, 2024

Conversation

sfc-gh-osalazarlizano
Copy link
Contributor

@sfc-gh-osalazarlizano sfc-gh-osalazarlizano commented Jun 17, 2024

Run tests for n quantity of sub-repos if there are modified files inside them. E.g.

Given the following repo structure:

/native-apps-examples
   |-mailorder
   |          |-*
   |-data-mapping
   |          |-*
   |-account-privileges
   |          |-*
   |...

From the structure above, if there are changes only in mailorder and account-privileges, just the tests for these sub-repos are going to be executed. data-mapping tests don't need to be execute because there are no changes inside the repo.

@sfc-gh-osalazarlizano sfc-gh-osalazarlizano marked this pull request as ready for review June 17, 2024 14:44
@sfc-gh-osalazarlizano sfc-gh-osalazarlizano marked this pull request as draft June 17, 2024 14:44
@sfc-gh-osalazarlizano sfc-gh-osalazarlizano changed the title Create python-app.yml Add CI pipeline for apps unit testing Jun 17, 2024
@sfc-gh-osalazarlizano sfc-gh-osalazarlizano marked this pull request as ready for review June 17, 2024 17:29
@sfc-gh-osalazarlizano sfc-gh-osalazarlizano changed the title Add CI pipeline for apps unit testing SNOW-1482571: Add CI pipeline for apps unit testing Jun 17, 2024
@sfc-gh-osalazarlizano sfc-gh-osalazarlizano marked this pull request as draft June 17, 2024 22:38
@sfc-gh-osalazarlizano sfc-gh-osalazarlizano marked this pull request as ready for review June 18, 2024 20:42
local_test_env.yml Outdated Show resolved Hide resolved
environment-file: ${{ matrix.environment-file }}
- name: Install dependencies
run: |
printf "[pytest]\npythonpath=${{ steps.tests_to_run.outputs.pytestPaths }}" > pytest.ini
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be enough to enforce that each individual app has its own pytest.ini and we can simply delegate to it. I don't think it's necessary to only run changed files -- unless I'm misreading this. Does this just delegate to individual inis?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are dynamically creating that in the root folder since the pytest command needs it in the folder to be executed. We are running tests from modified sub-repos, and this is why the pytest command is run globally and not in the individual app.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah got it. OK, that makes sense to me!

@sfc-gh-osalazarlizano sfc-gh-osalazarlizano merged commit eaf35b3 into main Jun 19, 2024
3 checks passed
@sfc-gh-osalazarlizano sfc-gh-osalazarlizano deleted the osalazarlizano/SNOW-1482571-ci-pipeline branch June 19, 2024 15:56
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.

2 participants