|
64 | 64 | end
|
65 | 65 | end
|
66 | 66 |
|
67 |
| -skipped_tests = [] |
68 | 67 |
|
69 |
| -# Response from Elasticsearch is just a String, so it's not possible to compare using headers. |
70 |
| -skipped_tests << { file: 'cat.aliases/20_headers.yml', |
71 |
| - description: 'Simple alias with yaml body through Accept header' } |
72 |
| - |
73 |
| -# Check version skip logic |
74 |
| -skipped_tests << { file: 'create/15_without_id.yml', |
75 |
| - description: 'Create without ID' } |
76 |
| - |
77 |
| -# No error is raised |
78 |
| -skipped_tests << { file: 'create/15_without_id_with_types.yml', |
79 |
| - description: 'Create without ID' } |
80 |
| - |
81 |
| -# Error message doesn't match |
82 |
| -skipped_tests << { file: 'tasks.get/10_basic.yml', |
83 |
| - description: 'get task test' } |
84 |
| - |
85 |
| -# No error is raised |
86 |
| -skipped_tests << { file: 'cat.allocation/10_basic.yml', |
87 |
| - description: '*' } |
88 |
| - |
89 |
| -# Figure out how to match response when there is an error |
90 |
| -skipped_tests << { file: 'delete/70_mix_typeless_typeful.yml', |
91 |
| - description: '*' } |
92 |
| - |
93 |
| -# Figure out how to match response when there is an error |
94 |
| -skipped_tests << { file: 'cat.templates/10_basic.yml', |
95 |
| - description: '*' } |
96 |
| - |
97 |
| -# Responses are there but not equal (eg.: yellow status) |
98 |
| -skipped_tests << { file: 'cluster.health/10_basic.yml', |
99 |
| - description: 'cluster health with closed index (pre 7.2.0)' } |
100 |
| - |
101 |
| -# Regular expression not catching exact match: |
102 |
| -skipped_tests << { file: 'cat.indices/10_basic.yml', |
103 |
| - description: 'Test cat indices output for closed index (pre 7.2.0)' } |
104 |
| - |
105 |
| -SKIPPED_TESTS = skipped_tests |
| 68 | +# Skipped tests |
| 69 | +file = File.expand_path(__dir__ + '/skipped_tests.yml') |
| 70 | +skipped_tests = YAML.load_file(file) |
106 | 71 |
|
107 | 72 | # The directory of rest api YAML files.
|
108 |
| -REST_API_YAML_FILES = SINGLE_TEST || Dir.glob("#{YAML_FILES_DIRECTORY}/**/*.yml") |
| 73 | +REST_API_YAML_FILES = if ENV['RUN_SKIPPED_TESTS'] # only run the skipped tests if true |
| 74 | + SKIPPED_TESTS = [] |
| 75 | + skipped_tests.map { |test| "#{YAML_FILES_DIRECTORY}/#{test[:file]}" } |
| 76 | + else |
| 77 | + # If not, define the skipped tests constant and try the single test or all |
| 78 | + # the tests |
| 79 | + SKIPPED_TESTS = skipped_tests |
| 80 | + SINGLE_TEST || Dir.glob("#{YAML_FILES_DIRECTORY}/**/*.yml") |
| 81 | + end |
109 | 82 |
|
110 | 83 | # The features to skip
|
111 | 84 | REST_API_YAML_SKIP_FEATURES = ['warnings', 'node_selector'].freeze
|
0 commit comments