Skip to content

Commit dc9e7fd

Browse files
committed
fixup! Have build-success as the last job in the workflow
1 parent ab2eb5f commit dc9e7fd

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

testing/trino-tests/src/test/java/io/trino/tests/ci/TestCiWorkflow.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,22 @@ public void testUploadTestResultsCondition()
103103
public void testBuildSuccessDependencies()
104104
throws Exception
105105
{
106-
String buildSuccessJobName = BUILD_SUCCESS;
107-
108106
Yaml yaml = new Yaml();
109107
Map<?, ?> workflow = yaml.load(new StringReader(Files.readString(findRepositoryRoot().resolve(CI_YML_REPO_PATH))));
110108
Map<String, ?> jobs = getMap(workflow, "jobs");
111109

112110
Set<String> allJobNames = jobs.keySet();
113-
assertThat(allJobNames).as("allJobNames").contains(buildSuccessJobName);
111+
assertThat(allJobNames).as("allJobNames").contains(BUILD_SUCCESS);
114112
List<String> testJobNames = allJobNames.stream()
115-
.filter(not(buildSuccessJobName::equals))
113+
.filter(not(BUILD_SUCCESS::equals))
116114
.sorted()
117115
.toList();
118-
Map<?, ?> buildSuccessJob = getMap(jobs, buildSuccessJobName);
116+
Map<?, ?> buildSuccessJob = getMap(jobs, BUILD_SUCCESS);
119117

120118
List<String> buildSuccessDependencies = getList(buildSuccessJob, "needs").stream()
121119
.map(String.class::cast)
122120
.toList();
123-
assertThat(buildSuccessDependencies).as("dependencies for %s", buildSuccessJobName)
121+
assertThat(buildSuccessDependencies).as("dependencies for %s", BUILD_SUCCESS)
124122
.isSorted()
125123
.doesNotHaveDuplicates()
126124
.containsExactlyElementsOf(testJobNames);
@@ -143,14 +141,13 @@ public void testBuildSuccessDependencies()
143141
public void testBuildSuccessIsLast()
144142
throws Exception
145143
{
146-
String buildSuccessJobName = BUILD_SUCCESS;
147144
Yaml yaml = new Yaml();
148145
Map<?, ?> workflow = yaml.load(new StringReader(Files.readString(findRepositoryRoot().resolve(CI_YML_REPO_PATH))));
149146
Map<String, ?> jobs = getMap(workflow, "jobs");
150147
// This assumes the `jobs` map preserves source order
151148
assertThat(getLast(jobs.keySet()))
152-
.describedAs("The %s job is logically last and depends on all others, we want it to be last in the source file".formatted(buildSuccessJobName))
153-
.isEqualTo(buildSuccessJobName);
149+
.describedAs("The %s job is logically last and depends on all others, we want it to be last in the source file", BUILD_SUCCESS)
150+
.isEqualTo(BUILD_SUCCESS);
154151
}
155152

156153
private static Path findRepositoryRoot()

0 commit comments

Comments
 (0)