Skip to content

Commit

Permalink
[ML] Better transforms ids.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Sep 10, 2020
1 parent c6f388f commit cd3703a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions x-pack/test/api_integration/apis/transform/transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ export default ({ getService }: FtrProviderContext) => {
const expected = {
apiTransformTransforms: {
count: 2,
transform1: { id: 'the-transform-1', destIndex: 'user-the-transform-1' },
transform2: { id: 'the-transform-2', destIndex: 'user-the-transform-2' },
transform1: { id: 'transform-test-get-1', destIndex: 'user-transform-test-get-1' },
transform2: { id: 'transform-test-get-2', destIndex: 'user-transform-test-get-2' },
typeOfVersion: 'string',
typeOfCreateTime: 'number',
},
apiTransformTransformsTransformId: {
count: 1,
transform1: { id: 'the-transform-1', destIndex: 'user-the-transform-1' },
transform1: { id: 'transform-test-get-1', destIndex: 'user-transform-test-get-1' },
typeOfVersion: 'string',
typeOfCreateTime: 'number',
},
Expand Down Expand Up @@ -82,8 +82,8 @@ export default ({ getService }: FtrProviderContext) => {
before(async () => {
await esArchiver.loadIfNeeded('ml/farequote');
await transform.testResources.setKibanaTimeZoneToUTC();
await createTransform('the-transform-1');
await createTransform('the-transform-2');
await createTransform('transform-test-get-1');
await createTransform('transform-test-get-2');
});

after(async () => {
Expand Down Expand Up @@ -123,7 +123,7 @@ export default ({ getService }: FtrProviderContext) => {
describe('/transforms/{transformId}', function () {
it('should return a specific transform configuration for super-user', async () => {
const { body } = await supertest
.get('/api/transform/transforms/the-transform-1')
.get('/api/transform/transforms/transform-test-get-1')
.auth(
USER.TRANSFORM_POWERUSER,
transform.securityCommon.getPasswordForUser(USER.TRANSFORM_POWERUSER)
Expand All @@ -137,7 +137,7 @@ export default ({ getService }: FtrProviderContext) => {

it('should return a specific transform configuration transform view-only user', async () => {
const { body } = await supertest
.get(`/api/transform/transforms/the-transform-1`)
.get(`/api/transform/transforms/transform-test-get-1`)
.auth(
USER.TRANSFORM_VIEWER,
transform.securityCommon.getPasswordForUser(USER.TRANSFORM_VIEWER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export default ({ getService }: FtrProviderContext) => {
const expected = {
apiTransformTransforms: {
count: 2,
transform1: { id: 'the-transform-1', state: TRANSFORM_STATE.STOPPED },
transform2: { id: 'the-transform-2', state: TRANSFORM_STATE.STOPPED },
transform1: { id: 'transform-test-stats-1', state: TRANSFORM_STATE.STOPPED },
transform2: { id: 'transform-test-stats-2', state: TRANSFORM_STATE.STOPPED },
typeOfStats: 'object',
typeOfCheckpointing: 'object',
},
Expand Down Expand Up @@ -62,8 +62,8 @@ export default ({ getService }: FtrProviderContext) => {
before(async () => {
await esArchiver.loadIfNeeded('ml/farequote');
await transform.testResources.setKibanaTimeZoneToUTC();
await createTransform('the-transform-1');
await createTransform('the-transform-2');
await createTransform('transform-test-stats-1');
await createTransform('transform-test-stats-2');
});

after(async () => {
Expand Down
12 changes: 6 additions & 6 deletions x-pack/test/api_integration/apis/transform/transforms_update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default ({ getService }: FtrProviderContext) => {
const expected = {
transformOriginalConfig: {
count: 1,
id: 'the-transform-1',
id: 'transform-test-update-1',
source: {
index: ['ft_farequote'],
query: { match_all: {} },
Expand Down Expand Up @@ -59,7 +59,7 @@ export default ({ getService }: FtrProviderContext) => {
before(async () => {
await esArchiver.loadIfNeeded('ml/farequote');
await transform.testResources.setKibanaTimeZoneToUTC();
await createTransform('the-transform-1');
await createTransform('transform-test-update-1');
});

after(async () => {
Expand All @@ -69,7 +69,7 @@ export default ({ getService }: FtrProviderContext) => {
it('should update a transform', async () => {
// assert the original transform for comparison
const { body: transformOriginalBody } = await supertest
.get('/api/transform/transforms/the-transform-1')
.get('/api/transform/transforms/transform-test-update-1')
.auth(
USER.TRANSFORM_POWERUSER,
transform.securityCommon.getPasswordForUser(USER.TRANSFORM_POWERUSER)
Expand All @@ -91,7 +91,7 @@ export default ({ getService }: FtrProviderContext) => {

// update the transform and assert the response
const { body: transformUpdateResponseBody } = await supertest
.post('/api/transform/transforms/the-transform-1/_update')
.post('/api/transform/transforms/transform-test-update-1/_update')
.auth(
USER.TRANSFORM_POWERUSER,
transform.securityCommon.getPasswordForUser(USER.TRANSFORM_POWERUSER)
Expand All @@ -111,7 +111,7 @@ export default ({ getService }: FtrProviderContext) => {

// assert the updated transform for comparison
const { body: transformUpdatedBody } = await supertest
.get('/api/transform/transforms/the-transform-1')
.get('/api/transform/transforms/transform-test-update-1')
.auth(
USER.TRANSFORM_POWERUSER,
transform.securityCommon.getPasswordForUser(USER.TRANSFORM_POWERUSER)
Expand All @@ -137,7 +137,7 @@ export default ({ getService }: FtrProviderContext) => {

it('should return 403 for transform view-only user', async () => {
await supertest
.post('/api/transform/transforms/the-transform-1/_update')
.post('/api/transform/transforms/transform-test-update-1/_update')
.auth(
USER.TRANSFORM_VIEWER,
transform.securityCommon.getPasswordForUser(USER.TRANSFORM_VIEWER)
Expand Down

0 comments on commit cd3703a

Please sign in to comment.