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

Speed up e2e-tests locally by skipping environment setup #3527

Merged
merged 5 commits into from
Jan 19, 2024

Conversation

noklam
Copy link
Contributor

@noklam noklam commented Jan 18, 2024

Description

While e2e-tests aim to simulate a fresh setup, it takes a lot of time to run the test because 95% of the time the tests is building up a new venv and pip install which is unlikely the problem.

I introduce a BEHAVE_LOCAL_ENV flag to skip this setup and additionally a e2e-tests-fast command in MAKEFILE. When developer want to quickly run some test, they can choose to enable the flag.

However, the CI should always run the full test, this is mainly for local development.

Development notes

Developer Certificate of Origin

We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a Signed-off-by line in the commit message. See our wiki for guidance.

If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.

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

@noklam noklam marked this pull request as ready for review January 18, 2024 15:57
@noklam noklam requested a review from merelcht as a code owner January 18, 2024 15:57
@noklam
Copy link
Contributor Author

noklam commented Jan 18, 2024

I did a quick test that it doesn't work very well on GitPod yet, locally it works fine. It seems to be a problem of the path of the virtualenv on GitPod.



def _install_project_requirements(context):
return
Copy link
Contributor

Choose a reason for hiding this comment

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

is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are not!

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
…o-org/kedro into noklam/local-speedup-e2e

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
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.

Thanks @noklam, this is pretty cool! :D

Makefile Show resolved Hide resolved
Copy link
Contributor

@SajidAlamQB SajidAlamQB left a comment

Choose a reason for hiding this comment

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

Nice, super handy for development! Thank you @noklam! 👍

Comment on lines +23 to +25
e2e-tests-fast: export BEHAVE_LOCAL_ENV=TRUE
e2e-tests-fast:
behave --tags=-skip --no-capture
Copy link
Member

Choose a reason for hiding this comment

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

Can't this be

Suggested change
e2e-tests-fast: export BEHAVE_LOCAL_ENV=TRUE
e2e-tests-fast:
behave --tags=-skip --no-capture
e2e-tests-fast:
BEHAVE_LOCAL_ENV=TRUE behave --tags=-skip --no-capture

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried this but it doesn't work. I am not an expert of Makefile so I am happy with change if you found a fix.

image

@noklam noklam merged commit db31ee6 into main Jan 19, 2024
28 checks passed
@noklam noklam deleted the noklam/local-speedup-e2e branch January 19, 2024 16:26
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.

4 participants