This commit is contained in:
Jan-Erik Rediger 2022-04-04 15:55:21 +02:00
Родитель 1132938825
Коммит aa2d2dea10
9 изменённых файлов: 21 добавлений и 19 удалений

Просмотреть файл

@ -2,6 +2,13 @@ style:
# We want to allow "TODO" in comments
ForbiddenComment:
active: false
# Allow for generated code
WildcardImport:
excludeImports:
- mozilla.telemetry.glean.internal.*
# Multiple returns are ok
ReturnCount:
active: false
build:
maxIssues: 0

Просмотреть файл

@ -182,8 +182,11 @@ detekt {
}
}
tasks.withType(io.gitlab.arturbosch.detekt.Detekt) {
exclude(".*test.*,.*/resources/.*,.*/tmp/.*,.*/build/.*")
tasks.withType(io.gitlab.arturbosch.detekt.Detekt).configureEach {
exclude("**/test/**")
exclude("**/resources/**")
exclude("**/tmp/**")
exclude("**/build/**")
}
configurations {

Просмотреть файл

@ -92,15 +92,6 @@ open class GleanInternalAPI internal constructor() {
private lateinit var gleanDataDir: File
// Keep track of this value before Glean is initialized
private var debugViewTag: String? = null
// Keep track of this value before Glean is initialized
private var logPings: Boolean = false
// Keep track of source tags if set before Glean is initialized.
private var sourceTags: Set<String>? = null
// Are we in testing mode?
internal var testingMode: Boolean = false

Просмотреть файл

@ -49,7 +49,8 @@ class CustomDistributionMetricType(
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
@JvmOverloads
fun testGetNumRecordedErrors(error: ErrorType, pingName: String? = null) = inner.testGetNumRecordedErrors(error, pingName)
fun testGetNumRecordedErrors(error: ErrorType, pingName: String? = null) =
inner.testGetNumRecordedErrors(error, pingName)
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
@JvmOverloads

Просмотреть файл

@ -73,7 +73,8 @@ class EventMetricType<ExtraKeysEnum, ExtraObject> internal constructor(
/**
* The public constructor used by automatically generated metrics.
*/
constructor(meta: CommonMetricData, allowedExtraKeys: List<String>) : this(inner = EventMetric(meta, allowedExtraKeys))
constructor(meta: CommonMetricData, allowedExtraKeys: List<String>) :
this(inner = EventMetric(meta, allowedExtraKeys))
/**
* Record an event by using the information provided by the instance of this class.

Просмотреть файл

@ -35,7 +35,8 @@ class MemoryDistributionMetricType(meta: CommonMetricData, memoryUnit: MemoryUni
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
@JvmOverloads
fun testGetNumRecordedErrors(error: ErrorType, pingName: String? = null) = inner.testGetNumRecordedErrors(error, pingName)
fun testGetNumRecordedErrors(error: ErrorType, pingName: String? = null) =
inner.testGetNumRecordedErrors(error, pingName)
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
@JvmOverloads

Просмотреть файл

@ -61,7 +61,8 @@ class TimingDistributionMetricType(meta: CommonMetricData, timeUnit: TimeUnit) :
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
@JvmOverloads
fun testGetNumRecordedErrors(error: ErrorType, pingName: String? = null) = inner.testGetNumRecordedErrors(error, pingName)
fun testGetNumRecordedErrors(error: ErrorType, pingName: String? = null) =
inner.testGetNumRecordedErrors(error, pingName)
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
@JvmOverloads

Просмотреть файл

@ -58,6 +58,7 @@ class GleanTestRule(
// Set the current system time to a known datetime.
val fakeNow = Calendar.getInstance()
fakeNow.clear()
@Suppress("MagicNumber") // it's a fixed date only used in tests.
fakeNow.set(2015, 6, 11, 2, 0, 0)
SystemClock.setCurrentTimeMillis(fakeNow.timeInMillis)

Просмотреть файл

@ -4,7 +4,6 @@
package mozilla.telemetry.glean.private
import android.content.Context
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import mozilla.telemetry.glean.Glean
@ -20,9 +19,6 @@ import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class LabeledMetricTypeTest {
private val context: Context
get() = ApplicationProvider.getApplicationContext()
@get:Rule
val gleanRule = GleanTestRule(ApplicationProvider.getApplicationContext())