Skip to content

Commit

Permalink
[ML] Fix commonAnnotationUpdateRequestBody
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Jul 30, 2020
1 parent 46e1641 commit 63414c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(fetchedAnnotation?.create_username).to.eql(USER.ML_POWERUSER);
});

it('should successfully create annotation for user without required permission', async () => {
it('should successfully create annotation for user with ML read permissions', async () => {
const { body } = await supertest
.put('/api/ml/annotations/index')
.auth(USER.ML_VIEWER, ml.securityCommon.getPasswordForUser(USER.ML_VIEWER))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ export default ({ getService }: FtrProviderContext) => {
const annotationUpdateRequestBody = {
...commonAnnotationUpdateRequestBody,
job_id: originalAnnotation._source.job_id,
type: ANNOTATION_TYPE.ANNOTATION,
event: 'model_change',
detector_index: 2,
partition_field_name: 'airline',
partition_field_value: 'ANA',
_id: originalAnnotation._id,
};

Expand Down Expand Up @@ -120,15 +115,8 @@ export default ({ getService }: FtrProviderContext) => {
const originalAnnotation = annotationsForJob[0];

const annotationUpdateRequestBody = {
timestamp: Date.now(),
end_timestamp: Date.now(),
annotation: 'Updated annotation',
...commonAnnotationUpdateRequestBody,
job_id: originalAnnotation._source.job_id,
type: ANNOTATION_TYPE.ANNOTATION,
event: 'model_change',
detector_index: 2,
partition_field_name: 'airline',
partition_field_value: 'ANA',
_id: originalAnnotation._id,
};

Expand Down

0 comments on commit 63414c1

Please sign in to comment.