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

Dnestoro/test contributing task2 #611

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
# Project versions
nativeBuildTools = "0.9.28"
nativeBuildTools = "0.10.5"

# External dependencies
junitPlatform = "1.9.2"
Expand Down
4 changes: 4 additions & 0 deletions metadata/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@
"allowed-packages" : [ "org.jooq" ],
"directory" : "org.jooq/jooq",
"module" : "org.jooq:jooq"
}, {
"allowed-packages" : [ "org.junit.jupiter" ],
"directory" : "org.junit.jupiter/junit-jupiter",
"module" : "org.junit.jupiter:junit-jupiter"
}, {
"allowed-packages" : [ "org.liquibase", "liquibase" ],
"directory" : "org.liquibase/liquibase-core",
Expand Down
7 changes: 7 additions & 0 deletions metadata/org.junit.jupiter/junit-jupiter/5.11.0/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
"jni-config.json",
"proxy-config.json",
"reflect-config.json",
"resource-config.json",
"serialization-config.json"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[
]
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,2 @@
[
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[
{
"condition":{"typeReachable":"org.junit.internal.builders.SuiteMethodBuilder"},
"name":"basic.BasicTest",
"methods":[{"name":"suite","parameterTypes":[] }]
},
{
"condition":{"typeReachable":"org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor"},
"name":"basic.BasicTest",
"queryAllDeclaredConstructors":true
},
{
"condition":{"typeReachable":"org.junit.jupiter.engine.descriptor.ExtensionUtils"},
"name":"basic.BasicTest",
"queryAllDeclaredConstructors":true
},
{
"condition":{"typeReachable":"org.junit.jupiter.engine.descriptor.LifecycleMethodUtils"},
"name":"basic.BasicTest",
"queryAllDeclaredMethods":true,
"queryAllPublicMethods":true
},
{
"condition":{"typeReachable":"org.junit.jupiter.engine.discovery.ClassSelectorResolver"},
"name":"basic.BasicTest",
"queryAllDeclaredMethods":true,
"queryAllPublicMethods":true
},
{
"condition":{"typeReachable":"org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests"},
"name":"basic.BasicTest",
"queryAllDeclaredMethods":true,
"queryAllPublicMethods":true
},
{
"condition":{"typeReachable":"org.junit.platform.commons.util.AnnotationUtils"},
"name":"basic.BasicTest"
},
{
"condition":{"typeReachable":"org.junit.platform.commons.util.ReflectionUtils"},
"name":"basic.BasicTest",
"allDeclaredFields":true,
"allDeclaredClasses":true,
"queryAllDeclaredMethods":true,
"queryAllPublicMethods":true,
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"resourceTest","parameterTypes":[] }]
},
{
"condition":{"typeReachable":"org.junit.vintage.engine.discovery.DefensiveAllDefaultPossibilitiesBuilder$DefensiveJUnit4Builder"},
"name":"basic.BasicTest",
"queryAllDeclaredMethods":true,
"queryAllPublicMethods":true
},
{
"condition":{"typeReachable":"org.junit.platform.launcher.listeners.OutputDir"},
"name":"java.security.SecureRandomParameters"
},
{
"condition":{"typeReachable":"org.junit.platform.launcher.listeners.OutputDir"},
"name":"sun.security.provider.NativePRNG",
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"<init>","parameterTypes":["java.security.SecureRandomParameters"] }]
},
{
"condition":{"typeReachable":"org.junit.platform.launcher.listeners.OutputDir"},
"name":"sun.security.provider.SHA",
"methods":[{"name":"<init>","parameterTypes":[] }]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"resources":{
"includes":[{
"condition":{"typeReachable":"org.junit.platform.launcher.core.LauncherFactory"},
"pattern":"\\QMETA-INF/services/org.junit.platform.engine.TestEngine\\E"
}, {
"condition":{"typeReachable":"org.junit.platform.launcher.core.LauncherFactory"},
"pattern":"\\QMETA-INF/services/org.junit.platform.launcher.TestExecutionListener\\E"
}, {
"condition":{"typeReachable":"org.junit.platform.commons.util.ReflectionUtils"},
"pattern":"\\Qresource.txt\\E"
}]},
"bundles":[]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"types":[
],
"lambdaCapturingTypes":[
],
"proxies":[
]
}
10 changes: 10 additions & 0 deletions metadata/org.junit.jupiter/junit-jupiter/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"latest": true,
"metadata-version": "5.11.0",
"module": "org.junit.jupiter:junit-jupiter",
"tested-versions": [
"5.11.0"
]
}
]
40 changes: 23 additions & 17 deletions tests/src/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,28 +179,28 @@
"versions" : [ "2.16.11" ]
} ]
}, {
"test-project-path" : "io.netty/netty-common/4.1.80.Final",
"test-project-path" : "io.netty/netty-common/4.1.115.Final",
"libraries" : [ {
"name" : "io.netty:netty-common",
"versions" : [ "4.1.80.Final" ]
"versions" : [ "4.1.115.Final" ]
} ]
}, {
"test-project-path" : "io.netty/netty-transport/4.1.80.Final",
"test-project-path" : "io.netty/netty-common/4.1.80.Final",
"libraries" : [ {
"name" : "io.netty:netty-transport",
"name" : "io.netty:netty-common",
"versions" : [ "4.1.80.Final" ]
} ]
}, {
"test-project-path" : "io.netty/netty-common/4.1.115.Final",
"test-project-path" : "io.netty/netty-transport/4.1.115.Final",
"libraries" : [ {
"name" : "io.netty:netty-common",
"name" : "io.netty:netty-transport",
"versions" : [ "4.1.115.Final" ]
} ]
}, {
"test-project-path" : "io.netty/netty-transport/4.1.115.Final",
"test-project-path" : "io.netty/netty-transport/4.1.80.Final",
"libraries" : [ {
"name" : "io.netty:netty-transport",
"versions" : [ "4.1.115.Final" ]
"versions" : [ "4.1.80.Final" ]
} ]
}, {
"test-project-path" : "io.opentelemetry/opentelemetry-exporter-jaeger/1.19.0",
Expand Down Expand Up @@ -437,16 +437,16 @@
"versions" : [ "10.15.0" ]
} ]
}, {
"test-project-path": "org.flywaydb/flyway-core/10.20.0",
"libraries": [ {
"name": "org.flywaydb:flyway-core",
"versions": [ "10.20.0" ]
"test-project-path" : "org.flywaydb/flyway-core/10.20.0",
"libraries" : [ {
"name" : "org.flywaydb:flyway-core",
"versions" : [ "10.20.0" ]
} ]
}, {
"test-project-path": "org.flywaydb/flyway-core/10.20.1",
"libraries": [ {
"name": "org.flywaydb:flyway-core",
"versions": [ "10.20.1" ]
"test-project-path" : "org.flywaydb/flyway-core/10.20.1",
"libraries" : [ {
"name" : "org.flywaydb:flyway-core",
"versions" : [ "10.20.1" ]
} ]
}, {
"test-project-path" : "org.flywaydb/flyway-core/9.0.1",
Expand Down Expand Up @@ -586,6 +586,12 @@
"name" : "org.jooq:jooq",
"versions" : [ "3.18.2" ]
} ]
}, {
"test-project-path" : "org.junit.jupiter/junit-jupiter/5.11.0",
"libraries" : [ {
"name" : "org.junit.jupiter:junit-jupiter",
"versions" : [ "5.11.0" ]
} ]
}, {
"test-project-path" : "org.liquibase/liquibase-core/4.17.0",
"libraries" : [ {
Expand Down Expand Up @@ -682,4 +688,4 @@
"name" : "samples:docker",
"versions" : [ "image-pull" ]
} ]
} ]
} ]
4 changes: 4 additions & 0 deletions tests/src/org.junit.jupiter/junit-jupiter/5.11.0/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gradlew.bat
gradlew
gradle/
build/
34 changes: 34 additions & 0 deletions tests/src/org.junit.jupiter/junit-jupiter/5.11.0/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright and related rights waived via CC0
*
* You should have received a copy of the CC0 legalcode along with this
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/

plugins {
id "org.graalvm.internal.tck"
}

String libraryVersion = tck.testedLibraryVersion.get()

dependencies {
testImplementation "org.junit.vintage:junit-vintage-engine:5.11.0"
testImplementation "org.junit.jupiter:junit-jupiter:$libraryVersion"
testImplementation 'org.assertj:assertj-core:3.22.0'
}

graalvmNative {
agent {
defaultMode = "conditional"
modes {
conditional {
userCodeFilterPath = "user-code-filter.json"
}
}
metadataCopy {
mergeWithExisting = false
inputTaskNames.add("test")
outputDirectories.add("metadata/org.junit.jupiter/junit-jupiter/5.11.0")
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
library.version = 5.11.0
metadata.dir = org.junit.jupiter/junit-jupiter/5.11.0/
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
pluginManagement {
def tckPath = Objects.requireNonNullElse(
System.getenv("GVM_TCK_TCKDIR"),
"../../../../tck-build-logic"
)
includeBuild(tckPath)
}

plugins {
id "org.graalvm.internal.tck-settings" version "1.0.0-SNAPSHOT"
}

rootProject.name = 'org.junit.jupiter.junit-jupiter_tests'
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package basic;

import org.junit.jupiter.api.Test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class BasicTest {

private static final String RESOURCE = "/resource.txt";

@Test
public void resourceTest() {
try(InputStream is = BasicTest.class.getResourceAsStream(RESOURCE)) {
assertNotNull(is);
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);

assertTrue(br.readLine().equalsIgnoreCase("Hello from resource!"));
} catch (IOException e) {
throw new RuntimeException(e);
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello from resource!
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rules": [
{"excludeClasses": "**"},
{"includeClasses": "org.junit.**"}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ plugins {
}

import groovy.json.JsonOutput
import org.graalvm.internal.tck.ContributionTask
import org.graalvm.internal.tck.DockerTask
import org.graalvm.internal.tck.ConfigFilesChecker
import org.graalvm.internal.tck.ScaffoldTask
import org.graalvm.internal.tck.GrypeTask
import org.graalvm.internal.tck.TestedVersionUpdaterTask
import org.graalvm.internal.tck.harness.tasks.CheckstyleInvocationTask
import org.graalvm.internal.tck.harness.tasks.FetchExistingLibrariesWithNewerVersionsTask
import org.graalvm.internal.tck.harness.tasks.GroupUnsupportedLibraries
import org.graalvm.internal.tck.updaters.FetchExistingLibrariesWithNewerVersionsTask
import org.graalvm.internal.tck.updaters.GroupUnsupportedLibraries
import org.graalvm.internal.tck.harness.tasks.TestInvocationTask


Expand Down Expand Up @@ -164,7 +165,7 @@ Provider<Task> generateMatrixDiffCoordinates = tasks.register("generateMatrixDif
}
}

// groovy tasks
// new library version updaters tasks
tasks.register("fetchExistingLibrariesWithNewerVersions", FetchExistingLibrariesWithNewerVersionsTask.class) { task ->
task.setGroup(METADATA_GROUP)
task.setDescription("Returns list of all libraries coordinates")
Expand All @@ -176,7 +177,13 @@ tasks.register("groupLibrariesByName", GroupUnsupportedLibraries.class) { task -
task.setDescription("Extracts groups of libraries from github comments provided in a form of string.")
}

// java tasks

tasks.register("addTestedVersion", TestedVersionUpdaterTask.class) { task ->
task.setDescription("Updates list of tested versions.")
task.setGroup(METADATA_GROUP)
}

// docker tasks
tasks.register("checkAllowedDockerImages", GrypeTask.class) { task ->
task.setDescription("Returns list of allowed docker images")
task.setGroup(METADATA_GROUP)
Expand All @@ -187,19 +194,21 @@ tasks.register("pullAllowedDockerImages", DockerTask.class) { task ->
task.setGroup(METADATA_GROUP)
}


// contributing tasks
tasks.register("scaffold", ScaffoldTask.class) { task ->
task.setDescription("Creates a metadata and test scaffold for the given coordindates")
task.setGroup(METADATA_GROUP)
// Format JSON after task has been run
task.finalizedBy("spotlessApply")
}

tasks.register("checkConfigFiles", ConfigFilesChecker.class) { task ->
task.setDescription("Checks content of config files for a new library.")
tasks.register("contribute", ContributionTask.class) { task ->
task.setDescription("Generates metadata and prepares pull request for contibuting on metadata repository based on provided tests.")
task.setGroup(METADATA_GROUP)
}

tasks.register("addTestedVersion", TestedVersionUpdaterTask.class) { task ->
task.setDescription("Updates list of tested versions.")
tasks.register("checkConfigFiles", ConfigFilesChecker.class) { task ->
task.setDescription("Checks content of config files for a new library.")
task.setGroup(METADATA_GROUP)
}
Loading
Loading