-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor propfind tests and add a new one (#18)
add new propfind tests restructure propfind tests
- Loading branch information
Showing
15 changed files
with
224 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
"singleQuote": true, | ||
"printWidth": 120, | ||
"tabWidth": 4 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,49 @@ | ||
import {RefinedResponse, ResponseType} from 'k6/http'; | ||
import { RefinedResponse, ResponseType } from 'k6/http'; | ||
|
||
import * as types from '../types'; | ||
import * as api from './api'; | ||
|
||
export class Create { | ||
public static exec( | ||
{ | ||
credential, | ||
shareType, | ||
shareWith, | ||
path, | ||
permissions, | ||
tags, | ||
}: { | ||
credential: types.Credential; | ||
shareType: string; | ||
shareWith: string; | ||
path: string; | ||
permissions: string; | ||
tags?: types.Tags; | ||
}): RefinedResponse<ResponseType> { | ||
public static exec({ | ||
credential, | ||
shareType, | ||
shareWith, | ||
path, | ||
permissions, | ||
tags, | ||
}: { | ||
credential: types.Credential; | ||
shareType: string; | ||
shareWith: string; | ||
path: string; | ||
permissions: string; | ||
tags?: types.Tags; | ||
}): RefinedResponse<ResponseType> { | ||
return api.request({ | ||
method: 'POST', | ||
credential, | ||
path: `/ocs/v1.php/apps/files_sharing/api/v1/shares`, | ||
params: {tags}, | ||
body: {shareType, shareWith, path, permissions}, | ||
params: { tags }, | ||
body: { shareType, shareWith, path, permissions }, | ||
}); | ||
} | ||
} | ||
|
||
export class Accept { | ||
public static exec( | ||
{ | ||
credential, | ||
id, | ||
tags, | ||
}: { | ||
credential: types.Credential; | ||
id: string; | ||
tags?: types.Tags; | ||
}): RefinedResponse<ResponseType> { | ||
public static exec({ | ||
credential, | ||
id, | ||
tags, | ||
}: { | ||
credential: types.Credential; | ||
id: string; | ||
tags?: types.Tags; | ||
}): RefinedResponse<ResponseType> { | ||
return api.request({ | ||
method: 'POST', | ||
credential, | ||
path: `/ocs/v1.php/apps/files_sharing/api/v1/shares/pending/${id}`, | ||
params: {tags}, | ||
params: { tags }, | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 4 additions & 10 deletions
14
...t/issue/github/ocis/1018/propfind/deep.ts → ...pfind/deep_1000_files_5_nested_folders.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
import { Options } from 'k6/options'; | ||
import { times } from 'lodash'; | ||
|
||
import { auth, defaults, k6, playbook, types, utils } from '../../../../../../lib'; | ||
import { default as propfind, options as propfindOptions } from './deep.lib'; | ||
import { auth, defaults, k6, types, utils } from '../../../../../../lib'; | ||
import { default as propfind, options as propfindOptions } from './shared.lib'; | ||
|
||
// put 1000 files into nested dirs and run a 'PROPFIND' through API | ||
const files: { | ||
size: number; | ||
unit: types.AssetUnit; | ||
}[] = times(1000, () => ({ size: 1, unit: 'KB' })); | ||
const authFactory = new auth(utils.buildAccount({ login: defaults.ACCOUNTS.EINSTEIN })); | ||
const plays = { | ||
davUpload: new playbook.dav.Upload(), | ||
davCreate: new playbook.dav.Create(), | ||
davPropfind: new playbook.dav.Propfind(), | ||
davDelete: new playbook.dav.Delete(), | ||
}; | ||
export const options: Options = k6.options({ | ||
tags: { | ||
test_id: 'propfind-deep', | ||
issue_url: 'github.com/owncloud/ocis/issues/1018', | ||
}, | ||
...propfindOptions({ plays, files }), | ||
...propfindOptions({ files }), | ||
}); | ||
|
||
export default (): void => propfind({ files, plays, credential: authFactory.credential, account: authFactory.account }); | ||
export default (): void => propfind({ files, credential: authFactory.credential, account: authFactory.account }); |
Oops, something went wrong.