From 8f53c8cc814be19c44bc8d5b98f9ddf94aa85da7 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Wed, 1 Feb 2023 14:14:23 +0100 Subject: [PATCH] Fix "requires" clauses being ignored This commit fixes the metadata repository not being used in the TCK. Before, it was assumed that each test was working in isolation, but in practice, #211 showed that it is not the case. So instead of the TCK figuring out by itself which metadata config to include, and completely ignoring the "requires" clauses, we will now simply configure the tests to use the metadata from the current state of the repository. It makes things easier, at the cost of possible side effects: it is possible that the metadata from a transitive dependency is actually what makes a build pass. However this drawback should be covered by regular code reviews, as it is unexpected that metadata for a transitive "talks" about the current module under test. Fixes #211 --- .../src/main/groovy/org.graalvm.internal.tck.gradle | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/tck-build-logic/src/main/groovy/org.graalvm.internal.tck.gradle b/tests/tck-build-logic/src/main/groovy/org.graalvm.internal.tck.gradle index 5d3717bba..716eb17e4 100644 --- a/tests/tck-build-logic/src/main/groovy/org.graalvm.internal.tck.gradle +++ b/tests/tck-build-logic/src/main/groovy/org.graalvm.internal.tck.gradle @@ -49,13 +49,6 @@ String metadataPath = Objects.requireNonNullElse( providers.gradleProperty('metadata.dir').get() ) -File metadataFile -if (!metadataPath.startsWith("/")) { - metadataFile = file(tck.metadataRoot).toPath().resolve(metadataPath).toFile() -} else { - metadataFile = file(metadataPath) -} - String libraryVersion = System.getenv("GVM_TCK_LV") ?: providers.gradleProperty('library.version').get() String libraryGAV = System.getenv("GVM_TCK_LC") ?: providers.gradleProperty('library.coordinates').getOrElse(null) @@ -79,9 +72,12 @@ tasks.named('test') { } graalvmNative { + metadataRepository { + enabled = true + uri(tck.metadataRoot.get().asFile) + } binaries { test { - configurationFileDirectories.from(metadataFile) if (override) { excludeConfig.put(libraryGAV, [".*"]) }