Skip to content

Commit

Permalink
[JENKINS-62104] Fix uploading Android debug symbols (#51)
Browse files Browse the repository at this point in the history
Co-authored-by: Aleksandr Suslov <[email protected]>
  • Loading branch information
subprogram and Aleksandr Suslov authored May 3, 2020
1 parent a472ef0 commit fe094ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
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

0 comments on commit fe094ed

Please sign in to comment.