Skip to content
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

SNOW-1693588 Upgrade to JUnit5 #1909

Open
wants to merge 87 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
8956d3f
Initial upgrade
sfc-gh-astachowski Oct 4, 2024
fe34193
Formatting fix
sfc-gh-astachowski Oct 4, 2024
4788157
Formatting fix
sfc-gh-astachowski Oct 4, 2024
ed62767
Removed extra dependencies
sfc-gh-astachowski Oct 4, 2024
c219985
Changed temporary directories
sfc-gh-astachowski Oct 4, 2024
17c51ad
Add explicit dependency on junit4
sfc-gh-astachowski Oct 4, 2024
50ba1ca
Add test scope to junit4
sfc-gh-astachowski Oct 4, 2024
c6db3ef
Pom fix
sfc-gh-astachowski Oct 4, 2024
63eaf4b
Added junit5 to test only pom
sfc-gh-astachowski Oct 4, 2024
3dd6e40
Added junit5 engine and migrated Assumptions
sfc-gh-astachowski Oct 9, 2024
8a503d5
Formatting
sfc-gh-astachowski Oct 9, 2024
9d71987
Attempt to fix dependencies
sfc-gh-astachowski Oct 10, 2024
84a8c34
Attempt to fix dependencies
sfc-gh-astachowski Oct 10, 2024
4c72889
Removed junit4 entirely
sfc-gh-astachowski Oct 11, 2024
af01a07
Formatting
sfc-gh-astachowski Oct 11, 2024
7461ef5
Fixed FIPS folder
sfc-gh-astachowski Oct 11, 2024
f5d91f4
Further fixes to FIPS
sfc-gh-astachowski Oct 11, 2024
8dbb729
Fixed package names
sfc-gh-astachowski Oct 11, 2024
5e7a55e
Changed to static imports
sfc-gh-astachowski Oct 11, 2024
62864ef
Changed categories to tags
sfc-gh-astachowski Oct 11, 2024
1a1b111
Formatting
sfc-gh-astachowski Oct 11, 2024
b8add67
Added test suites (expected to fail on old driver at the moment)
sfc-gh-astachowski Oct 25, 2024
39d8383
Fips fix
sfc-gh-astachowski Oct 25, 2024
158dc3b
Added dependencies for local testing
sfc-gh-astachowski Oct 29, 2024
d210c0e
Merge branch 'master' into SNOW-1693588-upgrade-to-junit5
sfc-gh-astachowski Oct 29, 2024
b18e508
Merge with master
sfc-gh-astachowski Oct 29, 2024
c418979
Formatting
sfc-gh-astachowski Oct 29, 2024
bf3b1d0
Added explicit junit4 dependency
sfc-gh-astachowski Oct 29, 2024
b593608
Removed test category from pom
sfc-gh-astachowski Oct 29, 2024
68805e9
Added explicit surefire provider
sfc-gh-astachowski Oct 29, 2024
335828e
Changed prepared statement tests to parameterized
sfc-gh-astachowski Oct 31, 2024
5f578b2
Formatting
sfc-gh-astachowski Oct 31, 2024
4899819
Merge master
sfc-gh-astachowski Oct 31, 2024
31023c4
Formatting
sfc-gh-astachowski Oct 31, 2024
4a97907
Refactored result set serializable tests from inheritance to paramete…
sfc-gh-astachowski Nov 5, 2024
73ce0fd
Refactored callable statement tests to avoid running a test twice
sfc-gh-astachowski Nov 5, 2024
704f86f
Fixed assertions of array equality
sfc-gh-astachowski Nov 5, 2024
c9b15df
Changed asserting a properties value to setting and reverting it
sfc-gh-astachowski Nov 5, 2024
6295d2c
Removed a class to avoid duplicating tests with parent class, in whic…
sfc-gh-astachowski Nov 5, 2024
239f71c
Formatting
sfc-gh-astachowski Nov 5, 2024
f8156ee
Script changes
sfc-gh-astachowski Nov 5, 2024
aa592b1
Added restoring static values in Session Util Test
sfc-gh-astachowski Nov 5, 2024
cabb3af
Added restoring static values in Trust Manager Test
sfc-gh-astachowski Nov 5, 2024
b5f811c
Ignore GCP test on Github Actions
sfc-gh-astachowski Nov 6, 2024
e045c7e
Fixed testing script
sfc-gh-astachowski Nov 6, 2024
37b6d16
Fixed testing script
sfc-gh-astachowski Nov 6, 2024
4d99bf7
Added closing input streams to Arrow Result Set IT
sfc-gh-astachowski Nov 6, 2024
52252f2
Removed Result Set Arrow IT, as it's parent class has previously been…
sfc-gh-astachowski Nov 6, 2024
e9001e0
Temporarily disabled potentially problematic test
sfc-gh-astachowski Nov 6, 2024
ac43895
Formatting
sfc-gh-astachowski Nov 6, 2024
3d0a3b3
Temporarily disabled failing test
sfc-gh-astachowski Nov 6, 2024
7641cc7
Disabled failsafe integration-test
sfc-gh-astachowski Nov 7, 2024
f53ba90
Running secure storage manager tests only on relevant systems
sfc-gh-astachowski Nov 7, 2024
a4a5d32
Added try-with-resources for input stream
sfc-gh-astachowski Nov 7, 2024
29a7dec
Added old driver tests
sfc-gh-astachowski Nov 7, 2024
e98c743
Formatting
sfc-gh-astachowski Nov 7, 2024
80c7458
Changed test provider for old driver tests
sfc-gh-astachowski Nov 7, 2024
ee773d3
Bumped the version of failsafe plugin
sfc-gh-astachowski Nov 7, 2024
11bafe5
Changed junit jupiter api version
sfc-gh-astachowski Nov 7, 2024
200fbb0
Removed unit tests from tests excluded from build
sfc-gh-astachowski Nov 7, 2024
c6a1656
Reverted dependency version change
sfc-gh-astachowski Nov 7, 2024
eed2726
Added unit tests back to exclude from compilation list for old driver…
sfc-gh-astachowski Nov 8, 2024
bdd0142
Removed Core and Unit tests from old drivers tests
sfc-gh-astachowski Nov 8, 2024
45a9394
Changed a dependency
sfc-gh-astachowski Nov 8, 2024
f1299ed
Changed a dependency
sfc-gh-astachowski Nov 8, 2024
2a94a10
Changed a dependency
sfc-gh-astachowski Nov 8, 2024
fce902c
Changed windows testing script to run multiple suites at once
sfc-gh-astachowski Nov 8, 2024
9c4e457
Restored old test names
sfc-gh-astachowski Nov 8, 2024
70fbd2a
Added copyright headers
sfc-gh-astachowski Nov 12, 2024
a59bec7
Removed empty file
sfc-gh-astachowski Nov 12, 2024
5729e22
Removed old ignore conditions and test categories
sfc-gh-astachowski Nov 12, 2024
49bfc08
Changed imports to assumptionUtil
sfc-gh-astachowski Nov 12, 2024
6f28e2e
Added missing copyright header
sfc-gh-astachowski Nov 12, 2024
6f9ae50
Renamed format providers to result format providers
sfc-gh-astachowski Nov 12, 2024
d35574f
Changed test annotation from junit4 to junit5
sfc-gh-astachowski Nov 12, 2024
8fb4e63
Moved throw assertions to relevant lines
sfc-gh-astachowski Nov 12, 2024
cb2239a
Added don't run on Github annotation
sfc-gh-astachowski Nov 12, 2024
afaf5d6
Merge branch 'master' into SNOW-1693588-upgrade-to-junit5
sfc-gh-astachowski Nov 14, 2024
2e33f77
Added system properties in build
sfc-gh-astachowski Nov 14, 2024
5aafdf2
Temporary disable test
sfc-gh-astachowski Nov 14, 2024
9197cd3
Temporary disable tests
sfc-gh-astachowski Nov 15, 2024
dd672e0
Script fix
sfc-gh-astachowski Nov 15, 2024
994b956
Added TODO
sfc-gh-astachowski Nov 15, 2024
e63c961
Re-enabled to test
sfc-gh-astachowski Nov 15, 2024
cca23d8
Formatting
sfc-gh-astachowski Nov 15, 2024
fa966fb
Disabled test with ticket attached
sfc-gh-astachowski Nov 15, 2024
8058d8e
Switched from failsafe to surefire
sfc-gh-astachowski Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions TestOnly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<jacoco.version>0.8.4</jacoco.version>
<jacoco.skip.instrument>true</jacoco.skip.instrument>
<jna.version>5.13.0</jna.version>
<junit.version>5.11.1</junit.version>
<junit4.version>4.13.2</junit4.version>
<mockito.version>3.5.6</mockito.version>
<shadeBase>net.snowflake.client.jdbc.internal</shadeBase>
<testCategory>net.snowflake.client.category.AllTestCategory</testCategory>
Expand All @@ -40,11 +42,28 @@
<version>3.0.0-M1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<type>jar</type>
<version>${junit4.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
35 changes: 33 additions & 2 deletions parent-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
<jna.version>5.13.0</jna.version>
<joda.time.version>2.8.1</joda.time.version>
<json.smart.version>2.4.9</json.smart.version>
<junit.version>4.13.2</junit.version>
<junit.version>5.11.1</junit.version>
<junit4.version>4.13.2</junit4.version>
sfc-gh-dprzybysz marked this conversation as resolved.
Show resolved Hide resolved
<jsoup.version>1.15.3</jsoup.version>
<logback.version>1.3.6</logback.version>
<metrics.version>2.2.0</metrics.version>
Expand Down Expand Up @@ -257,10 +258,28 @@
<artifactId>opencensus-api</artifactId>
<version>${opencensus.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
sfc-gh-astachowski marked this conversation as resolved.
Show resolved Hide resolved
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<version>${junit4.version}</version>
sfc-gh-astachowski marked this conversation as resolved.
Show resolved Hide resolved
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -719,6 +738,18 @@
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.sql.Connection;
import java.sql.SQLException;
import net.snowflake.client.AbstractDriverIT;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class SnowflakeDriverIT extends AbstractDriverIT {

Expand Down
3 changes: 0 additions & 3 deletions src/test/java/net/snowflake/client/AbstractDriverIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
import org.junit.Rule;

/** Base test class with common constants, data structures and methods */
public class AbstractDriverIT {
// This is required to use ConditionalIgnore annotation.
@Rule public ConditionalIgnoreRule rule = new ConditionalIgnoreRule();

public static final String DRIVER_CLASS = "net.snowflake.client.jdbc.SnowflakeDriver";
public static final String DRIVER_CLASS_COM = "com.snowflake.client.jdbc.SnowflakeDriver";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;

@Deprecated
sfc-gh-astachowski marked this conversation as resolved.
Show resolved Hide resolved
public class ConditionalIgnoreRule implements MethodRule {

public interface IgnoreCondition {
Expand Down
1 change: 1 addition & 0 deletions src/test/java/net/snowflake/client/RunningNotOnAWS.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package net.snowflake.client;

/** Run tests only on specified cloud provider or ignore */
@Deprecated
public class RunningNotOnAWS implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
String cloudProvider = TestUtil.systemGetEnv("CLOUD_PROVIDER");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package net.snowflake.client;

/** Run tests only on specified cloud provider or ignore */
@Deprecated
public class RunningNotOnAzure implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
String cloudProvider = TestUtil.systemGetEnv("CLOUD_PROVIDER");
Expand Down
1 change: 1 addition & 0 deletions src/test/java/net/snowflake/client/RunningNotOnGCP.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package net.snowflake.client;

/** Run tests only on specified cloud provider or ignore */
@Deprecated
public class RunningNotOnGCP implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
String cloudProvider = TestUtil.systemGetEnv("CLOUD_PROVIDER");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import net.snowflake.client.core.Constants;

@Deprecated
public class RunningNotOnGithubActionsMac implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
return isRunningOnGithubActionsMac();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static net.snowflake.client.jdbc.SnowflakeUtil.systemGetProperty;

@Deprecated
public class RunningNotOnJava21 implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
return isRunningOnJava21();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static net.snowflake.client.jdbc.SnowflakeUtil.systemGetProperty;

@Deprecated
public class RunningNotOnJava8 implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
return isRunningOnJava8();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.snowflake.client.core.Constants;

@Deprecated
public class RunningNotOnLinux implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
return Constants.getOS() != Constants.OS.LINUX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.snowflake.client.core.Constants;

@Deprecated
public class RunningNotOnLinuxMac implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
return Constants.getOS() != Constants.OS.LINUX && Constants.getOS() != Constants.OS.MAC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static net.snowflake.client.RunningOnGithubAction.isRunningOnGithubAction;

@Deprecated
public class RunningNotOnTestaccount implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
return (!("testaccount".equals(TestUtil.systemGetEnv("SNOWFLAKE_TEST_ACCOUNT")))
Expand Down
1 change: 1 addition & 0 deletions src/test/java/net/snowflake/client/RunningNotOnWin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.snowflake.client.core.Constants;

@Deprecated
public class RunningNotOnWin implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
return Constants.getOS() != Constants.OS.WINDOWS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.snowflake.client.core.Constants;

@Deprecated
public class RunningNotOnWinMac implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
return Constants.getOS() != Constants.OS.MAC && Constants.getOS() != Constants.OS.WINDOWS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package net.snowflake.client;

/** Run tests on CI */
@Deprecated
public class RunningOnGithubAction implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
return TestUtil.systemGetEnv("GITHUB_ACTIONS") != null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.snowflake.client;

@Deprecated
public class RunningOnTestaccount implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
return TestUtil.systemGetEnv("SNOWFLAKE_TEST_ACCOUNT").contains("testaccount");
Expand Down
1 change: 1 addition & 0 deletions src/test/java/net/snowflake/client/RunningOnWin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.snowflake.client.core.Constants;

@Deprecated
public class RunningOnWin implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
return Constants.getOS() == Constants.OS.WINDOWS;
Expand Down
1 change: 1 addition & 0 deletions src/test/java/net/snowflake/client/SkipOnThinJar.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package net.snowflake.client;

/** Skip tests on CI when thin jar is tested */
@Deprecated
public class SkipOnThinJar implements ConditionalIgnoreRule.IgnoreCondition {
@Override
public boolean isSatisfied() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@DisabledIfEnvironmentVariable(named = "GITHUB_ACTIONS", matches = ".*")
sfc-gh-dprzybysz marked this conversation as resolved.
Show resolved Hide resolved
public @interface DontRunOnGithubActions {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@DisabledOnJre(JRE.JAVA_21)
public @interface DontRunOnJava21 {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@DisabledOnJre(JRE.JAVA_8)
public @interface DontRunOnJava8 {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@DisabledIfEnvironmentVariable(named = "SNOWFLAKE_TEST_ACCOUNT", matches = "testaccount")
public @interface DontRunOnTestaccount {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@DisabledIfEnvironmentVariable(named = "ADDITIONAL_MAVEN_PROFILE", matches = "-Dthin-jar")
public @interface DontRunOnThinJar {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@DisabledOnOs(OS.WINDOWS)
public @interface DontRunOnWindows {}
12 changes: 12 additions & 0 deletions src/test/java/net/snowflake/client/annotations/RunOnAWS.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@EnabledIfEnvironmentVariable(named = "CLOUD_PROVIDER", matches = "(?i)AWS(?-i)")
public @interface RunOnAWS {}
12 changes: 12 additions & 0 deletions src/test/java/net/snowflake/client/annotations/RunOnAzure.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@DisabledIfEnvironmentVariable(named = "CLOUD_PROVIDER", matches = "(?i)Azure(?-i)")
public @interface RunOnAzure {}
12 changes: 12 additions & 0 deletions src/test/java/net/snowflake/client/annotations/RunOnGCP.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@DisabledIfEnvironmentVariable(named = "CLOUD_PROVIDER", matches = "(?i)GCP(?-i)")
public @interface RunOnGCP {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.condition.OS;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@EnabledIfEnvironmentVariable(named = "GITHUB_ACTIONS", matches = ".*")
sfc-gh-astachowski marked this conversation as resolved.
Show resolved Hide resolved
@DisabledOnOs(OS.MAC)
public @interface RunOnGithubActionsNotMac {}
13 changes: 13 additions & 0 deletions src/test/java/net/snowflake/client/annotations/RunOnLinux.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@EnabledOnOs({OS.LINUX, OS.AIX})
public @interface RunOnLinux {}
Loading
Loading