Skip to content

Commit fde2e92

Browse files
authored
ci: CI failure fixes (#23)
* ci: Allow codegen to run via Github Action * test: fix index deletion during integraton test teardown Was assuming permissions the user will not have on hidden indices
1 parent 3a4bad5 commit fde2e92

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.ci/make.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ docker build \
142142

143143
echo -e "\033[34;1mINFO: running $product container\033[0m"
144144

145-
# check BUILDKITE env var to enable support for both CI or running locally
146-
if [[ -z "${BUILDKITE+x}" ]]; then
145+
# check CI env vars to enable support for both CI or running locally
146+
if [[ -z "${BUILDKITE+x}" ]] || [[ -z "${CI+x}" ]]; then
147147
docker run \
148148
--volume "$repo:/usr/src/app" \
149149
--volume "$(realpath $repo/../elastic-client-generator-js):/usr/src/elastic-client-generator-js" \

test/integration/test-runner.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,12 +824,15 @@ function isNDJson (api) {
824824
* Hack around the fact that serverless doesn't allow deleting indices using wildcards
825825
*/
826826
async function deleteIndices(client) {
827-
const indices = await client.cat.indices()
828-
if (indices.length > 0) {
829-
const indexNames = indices.map(index => index.name)
827+
const indicesRaw = await client.cat.indices()
828+
const indexNames = indicesRaw
829+
.trim()
830+
.split('\n')
831+
.map(row => row.split(' ')[2])
832+
.filter(name => !name.startsWith('.'))
833+
if (indexNames.length > 0) {
830834
await client.indices.delete({
831835
index: indexNames.join(','),
832-
expand_wildcards: 'open,closed,hidden',
833836
}, { ignore: [404] })
834837
}
835838
}

0 commit comments

Comments
 (0)