-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 workingdir integration test #1625
Add workingdir integration test #1625
Conversation
I could not find a way to do a |
Would it be possible to phrase at least some of this test as a YAML test?
This has the benefit of being easier (I think) to read and understand in isolation. |
Good idea, updating the existing workdir.yaml with something like this? : diff --git a/examples/taskruns/workingdir.yaml b/examples/taskruns/workingdir.yaml
index e8a7d87f..73229cf8 100644
--- a/examples/taskruns/workingdir.yaml
+++ b/examples/taskruns/workingdir.yaml
@@ -12,6 +12,14 @@ spec:
- '-c'
- '[[ $PWD == /workspace ]]'
+ - name: default
+ image: ubuntu
+ command: ['bash']
+ workingDir: "foo" # implicitly mkdir's /workspace/foo
+ args:
+ - '-c'
+ - '[[ $PWD == /workspace/foo ]]'
+
- name: override
image: ubuntu
command: ['bash'] |
Yeah that sounds great. Is there anything else left in the Go test that can be YAMLified? |
@imjasonh I think the go test are still useful they make it implicit what should be expected, I I meant we need to make sure no output is coming back out of the There is another test in there too which make sure that workingdir with absolute path (ie |
It wouldn't. I'm just not sure how much that matters though. The test implicitly checks that the directory exists as expected, that's all I really care about. |
421d512
to
0b04943
Compare
@chmouel could you add some more detail in the commit message about what this commit is for? at the moment it just says "Add workingdir integration test" but it's hard to understand without context. I don't know what "workingdir integration test" is, and even from #1624 I'm not really sure what the workingdir feature is :S Sorry for the nitpicking!! But having a lot of info in our commit messages and in our issues is really important to me, and makes it a lot easier to make sure all the contributors can be on the same page. @chmouel (or anyone) feel free to remove this hold once we have some more details: |
0b04943
to
39155d2
Compare
@bobcatfish I kinda rephrased it, but would you like me to explain what the workingdir step is doing in the commit message? I think that would be a documentation update, isnt it ? |
CI error is unrelated to this commit but this #1634 would fix it, |
Thanks for the update! 🙏
I mean I would! I like to err on the side of being verbose, cuz it's really hard to know how much you'll know later - for example, say someone is looking at this commit message 2 years from now and the workingdir step is long gone but some of the lines of code remain, they'll have a really hard time understanding this change |
@bobcatfish I understand and if I could I would have link to the documentation from the commit message to explains what the workingdir but unfortunately it's not there :( |
39155d2
to
34db59d
Compare
/retest |
It doesnt not seem that a relative path for workingdir can actually work 🤔
|
Yeah that make sense 👼 |
I guess this code is not doing what expected then : It should be if filepath.IsAbs(p) || strings.HasPrefix(p, "/workspace/") { (currently it skips the absolute path like |
34db59d
to
7e272d7
Compare
/hold cancel |
CB> I guess this code is not doing what expected then : I'll work on a following PR to fix the code, |
7e272d7
to
826d591
Compare
We didn't check previously if workingdir step really worked properly. The workingdir container steps is taking care to make sure the workingdir directory is created into the workspace, Signed-off-by: Chmouel Boudjnah <[email protected]>
826d591
to
ef799ca
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester 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 |
Add an integration test checking the workingdirs
Following on review #1609 (review) we realised that there wasn't any integration test for the workingdir step, let's add some tests for this.
Closes #1624
Changes
We didn't check previously if workingdir really worked properly, let's add tests
for this.
/cc @imjasonh
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them: