From 0189a65e6bfc623813c6c088d19a0509fbeb64da Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 17 May 2017 10:24:57 -0400 Subject: [PATCH] Fail rest tests on yaml files (#24740) We've switched to supporting only `yml` files but anyone who didn't notice will commit a `yaml` file which won't be executed which is bad because it is easy not to notice. The test to catch this is simple enough that I think it is worth adding just to warn folks about their mistake. --- .../test/search.suggest/{20_phrase.yaml => 20_phrase.yml} | 0 .../elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java | 2 ++ 2 files changed, 2 insertions(+) rename modules/analysis-common/src/test/resources/rest-api-spec/test/search.suggest/{20_phrase.yaml => 20_phrase.yml} (100%) diff --git a/modules/analysis-common/src/test/resources/rest-api-spec/test/search.suggest/20_phrase.yaml b/modules/analysis-common/src/test/resources/rest-api-spec/test/search.suggest/20_phrase.yml similarity index 100% rename from modules/analysis-common/src/test/resources/rest-api-spec/test/search.suggest/20_phrase.yaml rename to modules/analysis-common/src/test/resources/rest-api-spec/test/search.suggest/20_phrase.yml diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java index 28bfa80cf27..98f770d9cc7 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java @@ -200,6 +200,8 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase { Files.walk(path).forEach(file -> { if (file.toString().endsWith(".yml")) { addSuite(root, file, files); + } else if (file.toString().endsWith(".yaml")) { + throw new IllegalArgumentException("yaml files are no longer supported: " + file); } }); } else {