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

Add E2E test for tools #3325

Merged
merged 42 commits into from
Nov 30, 2023
Merged

Add E2E test for tools #3325

merged 42 commits into from
Nov 30, 2023

Conversation

SajidAlamQB
Copy link
Contributor

@SajidAlamQB SajidAlamQB commented Nov 21, 2023

Description

For most of the add-ons flow I've been testing the work manually: create a new project with a combination of add-ons, install requirements and try a kedro run. This process has uncovered several bugs already.

Context

We should add automated tests to test at least some of the add-ons flow.

Implementation
At a minimum have tests for:

kedro new --addons=none
kedro new --addons=lint,docs,data,logging,... (everything but not viz and pyspark)
kedro new --addons=all
kedro new --addons=pyspark
kedro new --addons=viz

All of the above should have an example so kedro run can be tested.

Development Notes

  • Added relevant e2e tests for addons.
  • Updated GitHub Actions e2e config to support running PySpark

Checklist

  • Read the contributing guidelines
  • Signed off each commit with a Developer Certificate of Origin (DCO)
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the RELEASE.md file
  • Added tests to cover my changes
  • Checked if this change will affect Kedro-Viz, and if so, communicated that with the Viz team

Signed-off-by: SajidAlamQB <90610031+SajidAlamQB@users.noreply.github.com>
Signed-off-by: SajidAlamQB <90610031+SajidAlamQB@users.noreply.github.com>
@SajidAlamQB SajidAlamQB self-assigned this Nov 21, 2023
@SajidAlamQB SajidAlamQB marked this pull request as ready for review November 27, 2023 17:02
Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

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

The structure of the tests looks great, but I would make the check in check_created_project_structure_from_addons more specific to the selected tools. So if pyspark is selected, also check if spark.yml exists and for data that there's a data directory etc. For viz you might just have to check the run logs for the reporting pipeline.

@SajidAlamQB SajidAlamQB linked an issue Nov 29, 2023 that may be closed by this pull request
@AhdraMeraliQB
Copy link
Contributor

QQ: How is the --addons=all test passing with #3334 being unresolved?

@AhdraMeraliQB
Copy link
Contributor

Also: could we add tests that use the shorthand flag as well?

@SajidAlamQB
Copy link
Contributor Author

SajidAlamQB commented Nov 29, 2023

QQ: How is the --addons=all test passing with #3334 being unresolved?

The e2e tests are running via the --config not the --addons flag, where the --config uses the same code the normal cli wizard flow uses to parse all. The --addons flag uses _convert_addon_names_to_numbers which is where I think the problem for --addons=all is coming from see, #3334 (comment).

Copy link
Contributor

@AhdraMeraliQB AhdraMeraliQB left a comment

Choose a reason for hiding this comment

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

Thanks for adding these!

Porting over our conversation offline - it would be nice to see these tests ensure that the tools we provide are ready to go for the projects we add them to

e.g. pytest works for the test tool, black . and ruff check . work for linting, kedro viz should work for viz. Docs, logs, data structure, and pyspark are fine though - I'm not sure there's much more to test for those.

What do you think?

Signed-off-by: SajidAlamQB <90610031+SajidAlamQB@users.noreply.github.com>
Signed-off-by: SajidAlamQB <90610031+SajidAlamQB@users.noreply.github.com>
@SajidAlamQB SajidAlamQB changed the title Add E2E test for add-ons Add E2E test for tools Nov 30, 2023
Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

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

These tests are great, thanks for adding them @SajidAlamQB ! ⭐

@AhdraMeraliQB raises an interesting point, although I would personally say these are a "nice to have", because it's not technically our responsibility to ensure the behaviour of pytest and ruff and black. In the unit tests we check that the right requirements are added right? So then I think it's an okay assumption that when installed these work okay. But would be good to hear other opinions 🙂

@ankatiyar
Copy link
Contributor

^^ We could just run pip show ruff/black/pytest as a step to see if they were installed for the scenarios with lint/test tools but I also think these are nice to haves.

Copy link
Contributor

@ankatiyar ankatiyar left a comment

Choose a reason for hiding this comment

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

LGTM! 💯

Copy link
Member

@deepyaman deepyaman left a comment

Choose a reason for hiding this comment

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

Minor suggestions.

.github/workflows/e2e-tests.yml Outdated Show resolved Hide resolved
.github/workflows/e2e-tests.yml Outdated Show resolved Hide resolved
.github/workflows/e2e-tests.yml Outdated Show resolved Hide resolved
features/steps/cli_steps.py Outdated Show resolved Hide resolved
@SajidAlamQB
Copy link
Contributor Author

SajidAlamQB commented Nov 30, 2023

it's not technically our responsibility to ensure the behaviour of pytest and ruff and black. In the unit tests we check that the right requirements are added right? So then I think it's an okay assumption that when installed these work okay. But would be good to hear other opinions 🙂

I agree with this as well, I feel it is a bit out of the scope of this PR and more of a nice to have.

Copy link
Contributor

@DimedS DimedS left a comment

Choose a reason for hiding this comment

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

@SajidAlamQB , excellent work! LGTM

features/steps/cli_steps.py Outdated Show resolved Hide resolved
Signed-off-by: SajidAlamQB <90610031+SajidAlamQB@users.noreply.github.com>
@SajidAlamQB SajidAlamQB merged commit 190d2f7 into develop Nov 30, 2023
30 checks passed
@SajidAlamQB SajidAlamQB deleted the dev/e2e-test-for-add-ons branch November 30, 2023 17:17
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.

Add e2e tests for add-ons flow
6 participants