Skip to content

Commit

Permalink
Issue #6327 Ensure TempDirTest runs in envs other than CI (#6638)
Browse files Browse the repository at this point in the history
* Issue #6327 Ensure TempDirTest runs in envs other than CI

Signed-off-by: Jan Bartel <janb@webtide.com>

* pass sysproperty env=ci to surefire run

Signed-off-by: Olivier Lamy <oliver.lamy@gmail.com>

Co-authored-by: Olivier Lamy <oliver.lamy@gmail.com>
  • Loading branch information
janbartel and olamy committed Aug 20, 2021
1 parent 9f896c6 commit b2c420a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Expand Up @@ -27,6 +27,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

Expand Down Expand Up @@ -289,9 +290,11 @@ public void jettyBaseWorkExists() throws Exception

/**
* ServletContext.TEMPDIR has invalid <code>String</code> directory value (wrong permission to write into it)
* IllegalStateException
*
* Note that if run in the CI environment, the test will fail, because it runs as root,
* so we _will_ have permission to write to this directory.
*/
@Disabled("Jenkins will run as root so we do have permission to write to this directory.")
@DisabledIfSystemProperty(named = "env", matches = "ci")
@Test
public void attributeWithInvalidPermissions()
{
Expand Down
3 changes: 3 additions & 0 deletions pom.xml
Expand Up @@ -1458,6 +1458,9 @@
<version>${maven.surefire.version}</version>
<configuration>
<excludedGroups>external, large-disk-resource</excludedGroups>
<systemPropertyVariables>
<env>ci</env>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
Expand Down

0 comments on commit b2c420a

Please sign in to comment.