Skip to content

Commit

Permalink
Run the automated tests over the native image (#543)
Browse files Browse the repository at this point in the history
* trying to exclude groovy from classpath

* enabling int tests at the ci

* enabling int tests

* caffeine native image reflection configs

* adjusting resources config

* adjusting resources include config

* add missing graal resources metadata

* clean code

* flag is now unnecessary

* release notes

* [Gradle Release Plugin] - new version commit:  '3.25.10-snapshot'.
  • Loading branch information
mageddo authored Aug 7, 2024
1 parent 398467e commit c85cad3
Show file tree
Hide file tree
Showing 11 changed files with 7,408 additions and 7 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Set up JDK
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
# ['version', 'gds-token', 'java-version', 'components', 'github-token', 'set-java-home', 'cache', 'check-for-updates', 'native-image-musl', 'native-image-job-reports', 'native-image-pr-reports']

- name: Build and Tests
run: ./gradlew build test compTest -i
run: ./gradlew build test compTest -i

- name: Native Image Integration Tests
run: ./gradlew build -x check nativeIntTest -i
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 3.25.10
* Create `IntTests` suite, they are comp tests which can be run within native image, see the docs #480
* Upgrading necessary deps
* Fixing Caffeine dep broken dps binary image

## 3.25.9
* Handling and logging fatal errors #480
Expand Down
13 changes: 11 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ dependencies {

testImplementation("org.junit.jupiter:junit-jupiter:5.10.+")
testImplementation('org.mockito:mockito-junit-jupiter:5.12.+')
testImplementation ('org.hamcrest:hamcrest:3.0')
testImplementation('org.hamcrest:hamcrest:3.0')
testImplementation('io.rest-assured:rest-assured:5.5.0')

}
Expand Down Expand Up @@ -192,6 +192,14 @@ shadowJar {
}

graalvmNative {
agent {
defaultMode = "standard"
metadataCopy {
inputTaskNames.add("compTest")
outputDirectories.add("src/main/resources/META-INF/native-image/graal-auto-generated/")
mergeWithExisting = true
}
}
binaries {
main {
javaLauncher = javaToolchains.launcherFor {
Expand Down Expand Up @@ -227,10 +235,11 @@ release {

}

def dontCreateTagsAsTheCdWill(){
def dontCreateTagsAsTheCdWill() {
preTagCommit.enabled = false
createReleaseTag.enabled = false
}

dontCreateTagsAsTheCdWill()

tasks.register("updateNewVersion") {
Expand Down
11 changes: 9 additions & 2 deletions docs/content/4-developing/compiling.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,15 @@ $ java -jar dns-proxy-server-*-all.jar

### Native Image

```shell
$ ./gradlew clean build compTest shadowJar nativeCompile
Generated possible necessary metadata
```bash
./gradlew clean -Pagent compTest
./gradlew metadataCopy
```

Generate the binary
```bash
$ ./gradlew -x check clean build nativeIntTest nativeImageJar nativeCompile
$ ./build/native/nativeCompile/dns-proxy-server
```

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=3.25.9-snapshot
version=3.25.10-snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"name":"java.lang.Boolean",
"methods":[{"name":"getBoolean","parameterTypes":["java.lang.String"] }]
},
{
"name":"sun.instrument.InstrumentationImpl",
"methods":[{"name":"<init>","parameterTypes":["long","boolean","boolean","boolean"] }, {"name":"loadClassAndCallAgentmain","parameterTypes":["java.lang.String","java.lang.String"] }, {"name":"loadClassAndCallPremain","parameterTypes":["java.lang.String","java.lang.String"] }, {"name":"transform","parameterTypes":["java.lang.Module","java.lang.ClassLoader","java.lang.String","java.lang.Class","java.security.ProtectionDomain","byte[]","boolean"] }]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"type":"agent-extracted",
"classes":[
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[
{
"interfaces":[]
},
{
"interfaces":["net.bytebuddy.description.method.MethodDescription$InDefinedShape$AbstractBase$Executable"]
},
{
"interfaces":["net.bytebuddy.description.method.ParameterDescription$ForLoadedParameter$Parameter"]
},
{
"interfaces":["net.bytebuddy.description.method.ParameterList$ForLoadedExecutable$Executable"]
},
{
"interfaces":["net.bytebuddy.description.type.TypeDefinition$Sort$AnnotatedType"]
},
{
"interfaces":["net.bytebuddy.description.type.TypeDescription"]
},
{
"interfaces":["net.bytebuddy.description.type.TypeDescription$ForLoadedType$Dispatcher"]
},
{
"interfaces":["net.bytebuddy.description.type.TypeDescription$Generic"]
},
{
"interfaces":["net.bytebuddy.description.type.TypeDescription$Generic$AnnotationReader$Delegator$ForLoadedExecutableExceptionType$Dispatcher"]
},
{
"interfaces":["net.bytebuddy.description.type.TypeDescription$Generic$AnnotationReader$Delegator$ForLoadedExecutableParameterType$Dispatcher"]
},
{
"interfaces":["net.bytebuddy.description.type.TypeDescription$Generic$AnnotationReader$Delegator$ForLoadedField$Dispatcher"]
},
{
"interfaces":["net.bytebuddy.description.type.TypeDescription$Generic$AnnotationReader$Delegator$ForLoadedMethodReturnType$Dispatcher"]
},
{
"interfaces":["net.bytebuddy.description.type.TypeDescription$Generic$AnnotationReader$ForComponentType$AnnotatedParameterizedType"]
},
{
"interfaces":["net.bytebuddy.description.type.TypeDescription$Generic$AnnotationReader$ForTypeArgument$AnnotatedParameterizedType"]
},
{
"interfaces":["net.bytebuddy.description.type.TypeDescription$Generic$AnnotationReader$ForWildcardUpperBoundType$AnnotatedWildcardType"]
},
{
"interfaces":["net.bytebuddy.utility.JavaConstant$Simple$Dispatcher"]
},
{
"interfaces":["net.bytebuddy.utility.JavaConstant$Simple$Dispatcher$OfClassDesc"]
},
{
"interfaces":["net.bytebuddy.utility.JavaConstant$Simple$Dispatcher$OfDirectMethodHandleDesc"]
},
{
"interfaces":["net.bytebuddy.utility.JavaConstant$Simple$Dispatcher$OfDirectMethodHandleDesc$ForKind"]
},
{
"interfaces":["net.bytebuddy.utility.JavaConstant$Simple$Dispatcher$OfDynamicConstantDesc"]
},
{
"interfaces":["net.bytebuddy.utility.JavaConstant$Simple$Dispatcher$OfMethodHandleDesc"]
},
{
"interfaces":["net.bytebuddy.utility.JavaConstant$Simple$Dispatcher$OfMethodTypeDesc"]
},
{
"interfaces":["net.bytebuddy.utility.JavaModule$Module"]
},
{
"interfaces":["net.bytebuddy.utility.JavaModule$Resolver"]
},
{
"interfaces":["org.apache.http.client.methods.CloseableHttpResponse"]
}
]
Loading

0 comments on commit c85cad3

Please sign in to comment.