Issue #6327 Ensure TempDirTest runs in envs other than CI (#6638)

* 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>
This commit is contained in:
Jan Bartel 2021-08-20 11:40:18 +10:00 committed by GitHub
parent 9f896c6390
commit b2c420a124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -27,6 +27,7 @@ import org.junit.jupiter.api.AfterEach;
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;
@ -289,9 +290,11 @@ public class TempDirTest
/**
* 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()
{

View File

@ -1458,6 +1458,9 @@
<version>${maven.surefire.version}</version>
<configuration>
<excludedGroups>external, large-disk-resource</excludedGroups>
<systemPropertyVariables>
<env>ci</env>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>