-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Bootstrap entitlements for testing #129268
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
base: main
Are you sure you want to change the base?
Changes from all commits
2daa627
87b58f6
3248fd2
afaaf3d
c363a24
ee60773
ad955a5
3dd3962
caa6a70
08b16bb
c3b6388
687b904
c8f1af6
38c3f9c
f5a7c86
93878f9
bda4331
852eb83
d039ba4
c53e10a
6c1b7fd
8776617
3737d0a
d9517f7
2381c88
26baece
a846c50
e9093d3
b2bbf94
3c760da
65a7678
5ef8233
0b4273a
4c9acbb
a2fcb3a
4b36d55
48fe7cc
a2d8eb8
eea9cca
846c8b7
a9c83cc
3dffea1
ec76635
a5579b6
4338605
bc6b6c8
8c62d00
c7ff726
b5a1672
4e1a3b6
82d61e4
b5d3088
67ddd9c
f880bbc
015ad9f
4f0bc69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,7 +184,7 @@ private ChangelogEntry makeHighlightsEntry(int pr, boolean notable) { | |
} | ||
|
||
private String getResource(String name) throws Exception { | ||
return Files.readString(Paths.get(Objects.requireNonNull(this.getClass().getResource(name)).toURI()), StandardCharsets.UTF_8); | ||
return Files.readString(Paths.get(Objects.requireNonNull(this.getClass().getResource(name)).toURI()), StandardCharsets.UTF_8).replace("\r", ""); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is that for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test wasn't working on Windows. Tag @brianseeders |
||
} | ||
|
||
private void writeResource(String name, String contents) throws Exception { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,11 @@ | |
import org.gradle.api.provider.ProviderFactory; | ||
import org.gradle.api.tasks.SourceSet; | ||
import org.gradle.api.tasks.SourceSetContainer; | ||
import org.gradle.api.tasks.testing.Test; | ||
import org.gradle.language.jvm.tasks.ProcessResources; | ||
|
||
import java.util.List; | ||
|
||
import javax.inject.Inject; | ||
|
||
/** | ||
|
@@ -53,5 +56,9 @@ public void apply(Project project) { | |
project.getTasks().withType(ProcessResources.class).named("processResources").configure(task -> { | ||
task.into("META-INF", copy -> copy.from(testBuildInfoTask)); | ||
}); | ||
|
||
project.getTasks().withType(Test.class).matching(test -> List.of("test").contains(test.getName())).configureEach(test -> { | ||
test.systemProperty("es.entitlement.enableForTests", "true"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @breskeby is there a way to NOT enable this for serverless initially? |
||
}); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,4 +45,14 @@ configure(childProjects.values()) { | |
*/ | ||
apply plugin: 'elasticsearch.build' | ||
} | ||
|
||
// This is for any code potentially included in the server at runtime. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we just add this to the plugin-scanner project for now. In general we want to move more configuration where it belongs. adding code that might be needed in the future in sometime just adds clutter for now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It needs to apply to every lib except plugin-scanner. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Really, plugin-scanner shouldn't be in |
||
// Omit oddball libraries that aren't in server. | ||
def nonServerLibs = ['plugin-scanner'] | ||
if (false == nonServerLibs.contains(project.name)) { | ||
project.getTasks().withType(Test.class).matching(test -> ['test'].contains(test.name)).configureEach(test -> { | ||
test.systemProperty('es.entitlement.enableForTests', 'true') | ||
}) | ||
} | ||
|
||
} |
Uh oh!
There was an error while loading. Please reload this page.