@@ -349,19 +349,17 @@ private TestgridYaml buildTestgridYamlContent(JobConfigFile jobConfigFile) {
349349 StringBuilder testgridYamlBuilder = new StringBuilder ();
350350 String ls = System .lineSeparator ();
351351 testgridYamlBuilder
352- .append (getTestgridYamlFor (Paths . get (infraRepositoryLocation , TestGridConstants . TESTGRID_YAML )))
352+ .append (getTestgridYamlFor (getTestGridYamlLocation (infraRepositoryLocation )))
353353 .append (ls );
354354 String testgridYamlContent = testgridYamlBuilder .toString ().trim ();
355355 if (!testgridYamlContent .isEmpty ()) {
356356 if (!testgridYamlContent .contains ("deploymentConfig" )) {
357357 testgridYamlBuilder
358- .append (getTestgridYamlFor (
359- Paths .get (deployRepositoryLocation , TestGridConstants .TESTGRID_YAML )))
358+ .append (getTestgridYamlFor (getTestGridYamlLocation (deployRepositoryLocation )))
360359 .append (ls );
361360 }
362361 testgridYamlBuilder
363- .append (getTestgridYamlFor (
364- Paths .get (scenarioTestsRepositoryLocation , TestGridConstants .TESTGRID_YAML )))
362+ .append (getTestgridYamlFor (getTestGridYamlLocation (scenarioTestsRepositoryLocation )))
365363 .append (ls );
366364 } else {
367365 logger .warn (StringUtil .concatStrings (
@@ -630,4 +628,20 @@ protected NodeTuple representJavaBeanProperty(Object javaBean, Property property
630628 }
631629 }
632630 }
631+
632+ /**
633+ * If the testgrid yaml file is hidden in the directory, change the URI as to refer the hidden file.
634+ * @param directory directory where the testgrid yaml file exists
635+ * @return testgrid yaml file path
636+ */
637+ private Path getTestGridYamlLocation (String directory ) {
638+ Path hiddenYamlPath = Paths .get (
639+ directory , TestGridConstants .HIDDEN_FILE_INDICATOR + TestGridConstants .TESTGRID_YAML );
640+ Path defaultYamlPath = Paths .get (directory , TestGridConstants .TESTGRID_YAML );
641+ if (Files .exists (hiddenYamlPath )) {
642+ return hiddenYamlPath ;
643+ } else {
644+ return defaultYamlPath ;
645+ }
646+ }
633647}
0 commit comments