-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Improve testing for temp directories #5483
Conversation
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
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.
Good start, needs a couple of additions/changes. I'd also like to see all of the temp dir tests in a single test file, not just the tests for ServletContext.TEMPDIR.
Good call on the french cheese ;)
jetty-webapp/src/test/java/org/eclipse/jetty/webapp/ServletContextTmpAttributeTest.java
Outdated
Show resolved
Hide resolved
jetty-webapp/src/test/java/org/eclipse/jetty/webapp/ServletContextTmpAttributeTest.java
Outdated
Show resolved
Hide resolved
jetty-webapp/src/test/java/org/eclipse/jetty/webapp/ServletContextTmpAttributeTest.java
Outdated
Show resolved
Hide resolved
@Disabled("will fail if executed as root or super power user so Disabled it") | ||
public void attributeWithInvalidPermissionStringValue() throws Exception | ||
{ | ||
WebInfConfiguration webInfConfiguration = new WebInfConfiguration(); |
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.
Couldn't the test create a directory, then remove user read permission from it?
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.
but then the current user/process won't be able to delete it
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.
Once you've removed write permission, can't you put it back again before the test ends?
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@olamy there is a test failure for |
@lachlan-roberts yup I know it's because the docker image are run using root user. I'm changing that now but I had to change a bit our image to add a user see webtide/jenkins-slave@6834e91 |
@olamy should this one be passing now after those changes to the Dockerfile? |
@lachlan-roberts sadly not... because if the image is not started with the root user testcontainers cannot use docker :( |
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
I think we have a problem with our CI test environment: we rely on tests to execute to verify our builds and releases. If we go around commenting out tests, we'll never know if the software works or not! |
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
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.
@olamy I have made some cleanups and changes to the ServletContext.TEMPDIR
portion of the tests.
Can you also look at these disabled tests, we should do something about them.
jetty-webapp/src/test/java/org/eclipse/jetty/webapp/TempDirTest.java
Outdated
Show resolved
Hide resolved
jetty-webapp/src/test/java/org/eclipse/jetty/webapp/TempDirTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
There is apparently a checkstyle violation but I can't find it, not getting it when I build locally. |
@lachlan-roberts maybe you need to merge from 9.4.x to fix the checkstyle error? |
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@olamy any idea why in |
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
@lachlan-roberts weird. I have increased a bit timeout to see if this solve it. I don't understand why we need 3 times |
This PR has copyright header issues.
|
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
033397c
to
27e6e75
Compare
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
jetty-deploy/src/test/java/org/eclipse/jetty/deploy/DeploymentTempDirTest.java
Show resolved
Hide resolved
jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java
Show resolved
Hide resolved
jetty-webapp/src/test/java/org/eclipse/jetty/webapp/TempDirTest.java
Outdated
Show resolved
Hide resolved
jetty-deploy/src/test/java/org/eclipse/jetty/deploy/DeploymentTempDirTest.java
Show resolved
Hide resolved
jetty-deploy/src/test/java/org/eclipse/jetty/deploy/DeploymentTempDirTest.java
Show resolved
Hide resolved
jetty-deploy/src/test/java/org/eclipse/jetty/deploy/DeploymentTempDirTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
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
Improve testing around WebAppContext temporary directories. Signed-off-by: Lachlan Roberts <lachlan@webtide.com> Co-authored-by: olivier lamy <oliver.lamy@gmail.com>
* Improve testing for temp directories (#5483) Improve testing around WebAppContext temporary directories. Signed-off-by: Lachlan Roberts <lachlan@webtide.com> Co-authored-by: olivier lamy <oliver.lamy@gmail.com>
No description provided.