Skip to content

Commit

Permalink
fix: Disable mixpanel in tests (#2140)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotradamczyk5 authored Aug 17, 2021
1 parent 3e76b0c commit b112436
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/macos_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ jobs:
with:
arguments: "clean build"

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[Auto-commit] Added files fixed by Detekt"

- name: Codecov
uses: codecov/codecov-action@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion flank_wrapper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ shadowJar.apply {
}
}
// <breaking change>.<feature added>.<fix/minor change>
version = "1.2.2"
version = "1.2.3"
group = "com.github.flank"

repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
package com.github.flank.wrapper.internal

import flank.common.config.isTest
import flank.tool.analytics.mixpanel.Mixpanel

private const val FLANK_WRAPPER = "flank_wrapper"
private const val EVENT_RUN = "flank run"
private const val EVENT_NEW_FLANK_VERSION_DOWNLOADED = "new_version_downloaded"

internal fun sendAnalyticsNewFlankVersionDownloaded() {
Mixpanel.configure(FLANK_WRAPPER)
Mixpanel.configure(FLANK_WRAPPER, blockUsageStatistics = isTest())
Mixpanel.add(FLANK_WRAPPER, EVENT_NEW_FLANK_VERSION_DOWNLOADED)
Mixpanel.send(FLANK_WRAPPER)
}

internal fun sendAnalyticsFlankRun() {
Mixpanel.configure(FLANK_WRAPPER)
Mixpanel.configure(FLANK_WRAPPER, blockUsageStatistics = isTest())
Mixpanel.add(FLANK_WRAPPER, EVENT_RUN)
Mixpanel.send(FLANK_WRAPPER)
}
2 changes: 1 addition & 1 deletion flank_wrapper/src/main/resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.2
1.2.3
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ gcloud:
version: 13.6
orientation: portrait
locale: en_US
disable-usage-statistics: true
disable-usage-statistics: true
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ftl.analytics

import flank.common.config.isTest
import flank.tool.analytics.mixpanel.Mixpanel
import ftl.args.AndroidArgs
import ftl.args.IArgs
Expand All @@ -8,7 +9,7 @@ import ftl.args.IosArgs
internal fun IArgs.initUsageStatistics() {
Mixpanel.configure(
projectName = project,
blockUsageStatistics = disableUsageStatistics,
blockUsageStatistics = isTest() || disableUsageStatistics,
AndroidArgs::class,
IosArgs::class,
IArgs::class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ object Mixpanel {
projectName: String,
blockUsageStatistics: Boolean = false,
vararg statisticClasses: KClass<*>
): Unit = configureReport(
projectName = projectName,
blockUsageStatistics = blockUsageStatistics,
statisticClasses = statisticClasses
)
) {
configureReport(
projectName = projectName,
blockUsageStatistics = blockUsageStatistics,
statisticClasses = statisticClasses
)
}

fun removeSensitiveValues(map: ObjectMap): ObjectMap = map.removeNotNeededKeys().anonymizeSensitiveValues()

Expand Down

0 comments on commit b112436

Please sign in to comment.