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

fix(java): enable skipped tests for Native Image testing #1234

Merged
merged 25 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
88f4df4
make gax-grpc a test scope dependency
mpeddada1 Apr 22, 2022
c97371d
add resource config
mpeddada1 Apr 22, 2022
89729be
skip tests that use mockito
mpeddada1 Apr 22, 2022
5a31191
fix dependency issue
mpeddada1 Apr 22, 2022
513a769
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Apr 22, 2022
1bf69cc
add gax as main dependency; include supported architectures
mpeddada1 Apr 26, 2022
db0c2a0
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Apr 26, 2022
a43f3d1
fix dependency issue
mpeddada1 Apr 26, 2022
2a89d2d
add documentation; rever unnecessary changes
mpeddada1 May 11, 2022
a95bc9a
add documentation for exclusion
mpeddada1 May 11, 2022
2832a12
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 11, 2022
d474731
resolve conflicts
mpeddada1 May 11, 2022
ed3e773
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 11, 2022
39d9c4a
relocate gax-grpc dependency within pom.xml
mpeddada1 May 11, 2022
582f454
Merge branch 'main' into rename-tests
mpeddada1 May 18, 2022
d84d2be
try making gax-grpc provided
mpeddada1 May 20, 2022
9e29da7
explicitly include netty native image configurations
mpeddada1 May 20, 2022
8365b6e
remove gax from used dep setting
mpeddada1 May 21, 2022
2386fce
deps: update dependency com.google.cloud:google-cloud-shared-dependen…
renovate-bot May 18, 2022
1322931
feat: add build scripts for native image testing in Java 17 (#1440) (…
gcf-owl-bot[bot] May 19, 2022
27f1539
deps: update dependency com.google.cloud:google-cloud-shared-dependen…
renovate-bot May 20, 2022
97784fb
build(fix): add in IT args for graalvm presubmit (#1258)
kolea2 May 20, 2022
73e1c69
Merge branch 'main' into rename-tests
mpeddada1 May 26, 2022
80b82d8
remove netty configs
mpeddada1 May 26, 2022
d8f9224
fix pom.xml
mpeddada1 May 26, 2022
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
9 changes: 8 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,11 @@ mvn install -DskipUnitTests

# To skip all tests
mvn install -DskipTests
```
```


## Native Image Testing
Native Image testing is enabled for tests that follow a particular naming
convention (`IT*` or `*ClientTest`). Unit tests that use Mockito or EasyMock
have been excluded for the time being as they are not compatible with native
image compilation.
13 changes: 11 additions & 2 deletions google-cloud-bigtable-emulator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<!-- grpc-netty-shaded is used at test runtime -->
<usedDependencies>io.grpc:grpc-netty-shaded</usedDependencies>
<!-- grpc-netty-shaded is used at test runtime. gax-grpc is used for native image support -->
<usedDependencies>io.grpc:grpc-netty-shaded,com.google.api:gax-grpc</usedDependencies>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -101,6 +101,15 @@
<groupId>com.google.api</groupId>
<artifactId>api-common</artifactId>
</dependency>


<!-- This is needed when running the emulator classes with native image compilation -->
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
</dependency>
<!-- This is needed when running the emulator classes with native image compilation -->

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"resources":{
"includes":[
{
"pattern":"\\Qgcloud/bigtable-linux-x86_64/platform/bigtable-emulator/cbtemulator\\E"
},
{
"pattern":"\\Qgcloud/bigtable-darwin-x86_64/platform/bigtable-emulator/cbtemulator\\E"
},
{
"pattern":"\\Qgcloud/bigtable-linux-x86/platform/bigtable-emulator/cbtemulator\\E"
},
{
"pattern": "\\Qgcloud/bigtable-windows-x86_64/platform/bigtable-emulator/cbtemulator.exe\\E"
},
{
"pattern":"\\Qgcloud/bigtable-linux-arm/platform/bigtable-emulator/cbtemulator\\E"
}
]},
"bundles":[]
}
igorbernstein2 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public class BigtableEmulatorRuleTest {
public class ITBigtableEmulatorRuleTest {
igorbernstein2 marked this conversation as resolved.
Show resolved Hide resolved
@Rule public BigtableEmulatorRule bigtableRule = BigtableEmulatorRule.create();
private BigtableTableAdminBlockingStub tableAdminStub;
private BigtableBlockingStub dataStub;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@
import org.mockito.stubbing.Answer;

@RunWith(JUnit4.class)
public class BigtableInstanceAdminClientTest {
/**
* Tests for {@link BigtableTableAdminClient}. This test class uses Mockito so it has been
* explicitly excluded from Native Image testing by not following the naming convention of (IT* and
* *ClientTest).
*/
public class BigtableInstanceAdminClientTests {
igorbernstein2 marked this conversation as resolved.
Show resolved Hide resolved
@Rule public MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.WARN);

private static final String PROJECT_ID = "my-project";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@
import org.threeten.bp.Instant;

@RunWith(JUnit4.class)
public class BigtableTableAdminClientTest {
/**
* Tests for {@link BigtableTableAdminClient}. This test class uses Mockito so it has been
* explicitly excluded from Native Image testing by not following the naming convention of (IT* and
* *ClientTest).
*/
public class BigtableTableAdminClientTests {
@Rule public final MockitoRule mockitoRule = MockitoJUnit.rule();

private static final String PROJECT_ID = "my-project";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@
import org.mockito.stubbing.Answer;

@RunWith(JUnit4.class)
public class BigtableDataClientTest {
/**
* Tests for {@link BigtableDataClient}. This test class uses Mockito so it has been explicitly
* excluded from Native Image testing by not following the naming convention of (IT* and
* *ClientTest).
*/
public class BigtableDataClientTests {

@Rule public MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.WARN);

Expand Down