Skip to content

Commit

Permalink
allowing to load ftr archives
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema committed Mar 14, 2024
1 parent 52ff9b0 commit e20412e
Showing 1 changed file with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,35 @@ export const esArchiver = (
baseDir: '../es_archives',
});

const ftrEsArchiverInstance = new EsArchiver({
log,
client,
kbnClient,
baseDir: '../../functional/es_archives',
});

on('task', {
esArchiverLoad: async ({ archiveName, ...options }) =>
esArchiverInstance.load(archiveName, options),
esArchiverUnload: async (archiveName) => esArchiverInstance.unload(archiveName),
esArchiverLoad: async ({ archiveName, type = 'cypress', ...options }) => {
if (type === 'cypress') {
esArchiverInstance.load(archiveName, options);
} else if (type === 'ftr') {
ftrEsArchiverInstance.load(archiveName, options);
} else {
throw new Error('It is not possible to load the archive.');
}
return null;
},
esArchiverUnload: async (archiveName, type = 'cypress') => {
esArchiverInstance.unload(archiveName);
if (type === 'cypress') {
esArchiverInstance.unload(archiveName);
} else if (type === 'ftr') {
ftrEsArchiverInstance.unload(archiveName);
} else {
throw new Error('It is not possible to load the archive.');
}
return null;
},
});

return esArchiverInstance;
Expand Down

0 comments on commit e20412e

Please sign in to comment.