Skip to content

Commit

Permalink
only use tag for version number in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaHaddara committed Jan 14, 2025
1 parent 7ef4783 commit 42b0fb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith
import kotlin.math.exp
import kotlin.time.Duration.Companion.seconds

@RunWith(AndroidJUnit4::class)
Expand All @@ -23,10 +24,14 @@ class HoneycombOptionsInstrumentedTest {
fun runtimeVersion_isAutomaticallySet() {
val context = InstrumentationRegistry.getInstrumentation().targetContext
val options = HoneycombOptions.builder(context).build()

var expectedVersion = System.getenv("CIRCLE_TAG")
expectedVersion = expectedVersion?.slice(1 until expectedVersion.length) ?: "0.0.0-DEVELOPMENT"

assertEquals(
mapOf(
"service.name" to "unknown_service",
"honeycomb.distro.version" to "0.0.0-DEVELOPMENT",
"honeycomb.distro.version" to expectedVersion,
"honeycomb.distro.runtime_version" to Build.VERSION.RELEASE,
),
options.resourceAttributes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,15 @@ class HoneycombOptionsUnitTest {
)
val options = HoneycombOptions.Builder(HoneycombOptionsMapSource(data)).build()

var expectedVersion = System.getenv("CIRCLE_TAG")
expectedVersion = expectedVersion?.slice(1 until expectedVersion.length) ?: "0.0.0-DEVELOPMENT"

assertEquals("service", options.serviceName)
assertEquals(
mapOf(
"service.name" to "service",
"resource" to "aaa",
"honeycomb.distro.version" to "0.0.0-DEVELOPMENT",
"honeycomb.distro.version" to expectedVersion,
"honeycomb.distro.runtime_version" to "unknown",
),
options.resourceAttributes,
Expand Down

0 comments on commit 42b0fb3

Please sign in to comment.