Skip to content

Commit

Permalink
test: Update Jest snapshots and reference the 6.0 index
Browse files Browse the repository at this point in the history
The integration test on master is reference 7.0 because it aims
toward helping users migrate from 7.0 -> 8.0. The 7.x branch
is running 6.0 data as it helps migrate from older indices.
  • Loading branch information
jloleysens committed Mar 10, 2020
1 parent 38b7e9a commit 2542682
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ export default function({ getService }: FtrProviderContext) {

describe('status and _cluster/state contract', () => {
beforeEach(async () => {
await es.indices.open({ index: '7.0-data' });
await es.indices.open({ index: '6.0-data' });
});

afterEach(async () => {
await es.indices.open({ index: '7.0-data' });
await es.indices.open({ index: '6.0-data' });
});

// According to https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-state.html
// The response from this call is considered internal and subject to change. We check that
// the contract has not changed in this integration test.
it('the _cluster/state endpoint is still what we expect', async () => {
await esArchiver.load('upgrade_assistant/reindex');
await es.indices.close({ index: '7.0-data' });
await es.indices.close({ index: '6.0-data' });
const result = await es.cluster.state({
index: '7.0-data',
index: '6.0-data',
metric: 'metadata',
});

try {
if (getIndexStateFromClusterState('7.0-data', result.body) === 'close') {
if (getIndexStateFromClusterState('6.0-data', result.body) === 'close') {
return;
}
} catch (e) {
Expand All @@ -50,7 +50,7 @@ export default function({ getService }: FtrProviderContext) {
2
)}.
Expected body.metadata.indices['7.0-data'].state to be "close".`
Expected body.metadata.indices['6.0-data'].state to be "close".`
);
});
});
Expand Down

0 comments on commit 2542682

Please sign in to comment.