mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
[ci] Allow CI to be triggered by old elasticmachine-style comment (#105154)
This commit is contained in:
parent
b250f06b09
commit
37b57a411b
4 changed files with 130 additions and 4 deletions
|
@ -13,11 +13,11 @@ describe("generatePipelines", () => {
|
|||
});
|
||||
|
||||
// Helper for testing pipeline generations that should be the same when using the overall ci trigger comment "buildkite test this"
|
||||
const testWithTriggerCheck = (directory: string, changedFiles?: string[]) => {
|
||||
const testWithTriggerCheck = (directory: string, changedFiles?: string[], comment = "buildkite test this") => {
|
||||
const pipelines = generatePipelines(directory, changedFiles);
|
||||
expect(pipelines).toMatchSnapshot();
|
||||
|
||||
process.env["GITHUB_PR_TRIGGER_COMMENT"] = "buildkite test this";
|
||||
process.env["GITHUB_PR_TRIGGER_COMMENT"] = comment;
|
||||
const pipelinesWithTriggerComment = generatePipelines(directory, changedFiles);
|
||||
expect(pipelinesWithTriggerComment).toEqual(pipelines);
|
||||
};
|
||||
|
@ -42,4 +42,20 @@ describe("generatePipelines", () => {
|
|||
const pipelines = generatePipelines(`${import.meta.dir}/mocks/pipelines`, ["build.gradle"]);
|
||||
expect(pipelines).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test("should generate correct pipelines with a non-docs change and @elasticmachine", () => {
|
||||
testWithTriggerCheck(
|
||||
`${import.meta.dir}/mocks/pipelines`,
|
||||
["build.gradle", "docs/README.asciidoc"],
|
||||
"@elasticmachine test this please"
|
||||
);
|
||||
});
|
||||
|
||||
test("should generate correct pipelines with a non-docs change and @elasticsearchmachine", () => {
|
||||
testWithTriggerCheck(
|
||||
`${import.meta.dir}/mocks/pipelines`,
|
||||
["build.gradle", "docs/README.asciidoc"],
|
||||
"@elasticsearchmachine test this please"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue