Skip to content
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

[JENKINS-62104] Fix uploading Android debug symbols #51

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ private SymbolUploadBeginRequest symbolUploadRequest(@Nonnull String pathToApp,

@Nonnull
private SymbolUploadBeginRequest androidSymbolsUpload(@Nonnull String pathToApp, @Nonnull String pathToDebugSymbols) throws IOException {
final File file = new File(filePath.child(pathToApp).getRemote());
final AndroidParser androidParser = parserFactory.androidParser(file);
final String fileName = androidParser.fileName();
final File apkFile = new File(filePath.child(pathToApp).getRemote());
final File debugSymbolsFile = new File(filePath.child(pathToDebugSymbols).getRemote());
final AndroidParser androidParser = parserFactory.androidParser(apkFile);
final String fileName = debugSymbolsFile.getName();
final String versionCode = androidParser.versionCode();
final String versionName = androidParser.versionName();
final SymbolTypeEnum symbolType = getAndroidSymbolTypeEnum(pathToDebugSymbols);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,9 @@ public void should_ReturnModifiedRequest_When_DebugSymbolsExists_Android() throw
given(mockFilePath.child(anyString())).willReturn(mockFilePath);
given(mockFilePath.getRemote()).willReturn(pathToDebugSymbols);
given(mockParserFactory.androidParser(any(File.class))).willReturn(mockAndroidParser);
given(mockAndroidParser.fileName()).willReturn("app.apk");
given(mockAndroidParser.versionCode()).willReturn("1");
given(mockAndroidParser.versionName()).willReturn("1.0.0");
final SymbolUploadBeginRequest symbolUploadBeginRequest = new SymbolUploadBeginRequest(AndroidProguard, null, "app.apk", "1", "1.0.0");
final SymbolUploadBeginRequest symbolUploadBeginRequest = new SymbolUploadBeginRequest(AndroidProguard, null, "mapping.txt", "1", "1.0.0");
final UploadRequest expected = fullUploadRequest.newBuilder()
.setPathToApp(pathToApp)
.setPathToDebugSymbols(pathToDebugSymbols)
Expand Down Expand Up @@ -156,10 +155,9 @@ public void should_ReturnModifiedRequest_When_DebugSymbolsExists_Android_Breakpa
given(mockFilePath.child(anyString())).willReturn(mockFilePath);
given(mockFilePath.getRemote()).willReturn(pathToDebugSymbols);
given(mockParserFactory.androidParser(any(File.class))).willReturn(mockAndroidParser);
given(mockAndroidParser.fileName()).willReturn("app.apk");
given(mockAndroidParser.versionCode()).willReturn("1");
given(mockAndroidParser.versionName()).willReturn("1.0.0");
final SymbolUploadBeginRequest symbolUploadBeginRequest = new SymbolUploadBeginRequest(Breakpad, null, "app.apk", "1", "1.0.0");
final SymbolUploadBeginRequest symbolUploadBeginRequest = new SymbolUploadBeginRequest(Breakpad, null, "breakpad-symbols.zip", "1", "1.0.0");
final UploadRequest expected = fullUploadRequest.newBuilder()
.setPathToApp(pathToApp)
.setPathToDebugSymbols(pathToDebugSymbols)
Expand Down