-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
✨ Make it possible to run envtest-based integration tests from vscode #8088
✨ Make it possible to run envtest-based integration tests from vscode #8088
Conversation
/cc @Jont828 |
8dd4dba
to
4202349
Compare
(Sorry, I accidentally left some lines uncommitted; amended and force-pushed) |
/lgtm |
LGTM label has been added. Git tree hash: 4e400552e8d9197a80558f40016886b778418b0b
|
I'll squash now, since the first commits are no longer relevant at all. |
a2dc9a4
to
e0f12f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dlipovetsky!
@ykakarap I think you're using VScode? Any insight into how you're currently running envtest tests would be useful 🙂
Thx! Let's see if some other VSCode users want to chime in. (I'm using Intellij) /lgtm Feel free to ping me back for an approval in a bit :) |
LGTM label has been added. Git tree hash: ea27f85112d9e06b5d9555118529836f9bfe6b24
|
/cherry-pick release-1.3 |
@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.3 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Thanks for the reviews. Come to think of it, any project that uses envtest (probably most infrastructure providers) can use this approach. |
This worked a treat for me, this is great. Thanks @dlipovetsky 🙇 One comment, should we move the |
Good question!
I can see how it might be bothersome, although personally I'm ok with it, since the directories are "hidden." On the other hand, being hidden, the directories are had to discover for new users.
I don't see one, but I'd be open to this. For example
|
I think it would be cleaner to have this in a text block in the CAPI book, so we don't need to keep example files around. This is what we do e.g. for the tilt-settings file, and it works well IMO. |
The user can apply tilt-settings by pasting the contents to one file. Here, the user must paste the contents to two files ( I thought having the example files in the repo would make easy what I assume is the common use, where the user does not have But I'm fine with copy-paste, too. I'm just trying to help out fellow vscode users 😄 |
I'd personally prefer to have a file where I can just rename to use the stock config. I like the idea of having everything packaged together like a dotfiles directory and that way you don't have to set up the folder structure too. |
/lgtm |
For something like this with multiple files, I'd agree with @Jont828 that being to rename or copy a whole directory is easier than having to cut & paste from docs. I like the idea of the
And then the docs can say something like:
|
I'm happy with the idea of a dev folder - I'm just sensitive to including config for external tools in the repo, but happy to give a try to see how it works 🙂 |
Link check should be fine - it's failing as expected and will be fixed on merge. /lgtm |
LGTM label has been added. Git tree hash: ffcf7cdb032ae772b3400b16434fb41b350f9ffd
|
(The PR Markdown links job fails, but the links will work once the PR is merged) |
I'd like to squash the fixup commits, but that'll remove the lgtm... Not sure if "squash merge" is an option? |
You can squash the commits and I'll lgtm again 🙂 We don't do squash merge normally. |
@dlipovetsky If you only squash the commits without rebasing onto main the lgtm will stay. (the git tree hash stored in #8088 (comment) (details) has to be the same) |
9f6a669
to
fc1f6d0
Compare
Thanks for the feedback, everyone! 🙏 |
@dlipovetsky could you squash this down to a single commit? |
* Add 'setup-envtest' make target to setup envtest on demand. * Document how to configure VSCode.
fc1f6d0
to
4888af5
Compare
/lgtm |
LGTM label has been added. Git tree hash: 9311781ea1062cc55d68bf8ad441f99ee8fed246
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: killianmuldoon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@sbueringer: new pull request created: #8212 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What this PR does / why we need it:
Those of developing cluster-api using vscode need to run envtest-based integration tests. To do this, we must (a) set up envtest manually, and (b) configure vscode to discover the envtest artifacts. Every time the envtest version changes, we have to repeat these steps. These steps are not documented. Developers often resort to
make test
, and lose the features of vscode for running and debugging tests.This PR creates (a) configures vscode-go to read environment variables from a file, and (b) creates a "vscode task" that runs a make target to set up envtest, and to record the envtest artifact location to the file.
Once the task is run, developers can run integration tests directly from vscode.
Developers can optionally enable the task to automatically run whenever they open the workspace.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #