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

Fix classifier value, use value from report #113

Merged
merged 4 commits into from
Nov 28, 2023
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
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ jobs:
run: |
saucectl configure --username ${{ secrets.SAUCE_USERNAME }} --accessKey ${{ secrets.SAUCE_ACCESS_KEY }}
# recent real device
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --device name="Samsung_Galaxy_S20_FE_5G_backtrace_us"
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --device name="Samsung_Galaxy_S20_FE_5G_backtrace_us" --region us-west-1
# newest Android version
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --emulator name="Android GoogleApi Emulator,platformVersion=12.0"
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --emulator name="Android GoogleApi Emulator,platformVersion=12.0" --region us-west-1
# oldest Android version
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --emulator name="Android GoogleApi Emulator,platformVersion=5.1"
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --emulator name="Android GoogleApi Emulator,platformVersion=5.1" --region us-west-1
# oldest real device (aiming for armv7 / 32bit)
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --device name=".*,platformVersion=6.0.1"
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --device name=".*,platformVersion=6.0.1" --region us-west-1
# --device name=".*,platformVersion=6.0.1"
# --device name="Samsung_Galaxy_S20_FE_5G_backtrace_us"
# --device name="Samsung_Galaxy_S22_Ultra_5G_backtrace_us"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package backtraceio.library.models;

import static org.junit.Assert.assertEquals;

import android.content.Context;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.HashMap;

import backtraceio.library.models.json.BacktraceReport;

@RunWith(AndroidJUnit4.class)
public class BacktraceDataTest {
private Context context;

@Before
public void setUp() {
context = InstrumentationRegistry.getInstrumentation().getContext();
}

@Test
public void createBacktraceDataTest() {
// GIVEN
BacktraceReport report = new BacktraceReport(new IllegalAccessException("test-message"));

// WHEN
BacktraceData backtraceData = new BacktraceData(context, report, new HashMap<>());

// THEN
assertEquals(backtraceData.classifiers, new String[]{"java.lang.IllegalAccessException"});
assertEquals(backtraceData.report, report);
assertEquals(backtraceData.attributes.get("classifier"), "java.lang.IllegalAccessException");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private void setExceptionAttributes(BacktraceReport report) {
this.attributes.put("error.message", report.message);
return;
}
this.attributes.put("classifier", report.exception.getClass().getName());
this.attributes.put("classifier", report.classifier);
this.attributes.put("error.message", report.exception.getMessage());
}

Expand Down
Loading