-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EPMRPP-81154 || Launch import improvements #1677
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,8 @@ | |
|
||
@Service | ||
public class ImportLaunchHandlerImpl implements ImportLaunchHandler { | ||
private static final int MAX_FILE_SIZE = 32 * 1024 * 1024; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
private ImportStrategyFactory importStrategyFactory; | ||
private MessageBus messageBus; | ||
|
||
|
@@ -81,6 +83,7 @@ private void validate(MultipartFile file) { | |
expect(file.getOriginalFilename(), it -> it.endsWith(ZIP_EXTENSION) || it.endsWith(XML_EXTENSION)).verify(INCORRECT_REQUEST, | ||
"Should be a zip archive or an xml file " + file.getOriginalFilename() | ||
); | ||
expect(file.getSize(), size -> size <= MAX_FILE_SIZE).verify(INCORRECT_REQUEST, "File size is more than 32 Mb."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
private File transferToTempFile(MultipartFile file) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -371,7 +371,7 @@ public DeleteBulkRS deleteLaunches(@PathVariable String projectName, @RequestBod | |
|
||
@PostMapping(value = "/import", consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) | ||
@ResponseStatus(OK) | ||
@ApiOperation(value = "Import junit xml report", notes = "Only following formats are supported: zip.") | ||
@ApiOperation(value = "Import junit xml report", notes = "Only following formats are supported: zip and xml.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
public OperationCompletionRS importLaunch(@PathVariable String projectName, @RequestParam("file") MultipartFile file, | ||
@AuthenticationPrincipal ReportPortalUser user, HttpServletRequest request) { | ||
return importLaunchHandler.importLaunch(projectExtractor.extractProjectDetails(user, normalizeId(projectName)), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line contains a tab character.