Skip to content

Commit

Permalink
Beam: handle commas in Sentry DSN parameter (close #391)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjben committed Nov 5, 2020
1 parent 9d4cfaa commit 415e00a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ object config {
resolver,
args.optional("enrichments"),
args.optional("labels"),
args.optional("sentry-dsn"),
args.asMap.get("sentry-dsn").map(_.mkString(",")),
args.boolean("metrics", true)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class ConfigSpec extends AnyFreeSpec with EitherValues {
)
}
"which succeeds if --sentry-dsn is present" in {
val dsn = "https://foo.bar?stacktrace.app.packages=com.snowplowanalytics.snowplow.enrich.beam&tags=cloud:GCP,pipeline_name:dev,client_name:tests,region:ES&release=1.0.0&async=false"
val args = Args(
Array(
"--job-name=j",
Expand All @@ -130,11 +131,11 @@ class ConfigSpec extends AnyFreeSpec with EitherValues {
"--bad=b",
"--pii=p",
"--resolver=r",
"--sentry-dsn=DSN"
s"--sentry-dsn=$dsn"
)
)
EnrichConfig(args) shouldEqual Right(
EnrichConfig("j", "i", "o", "b", Some("p"), "r", None, None, Some("DSN"), true)
EnrichConfig("j", "i", "o", "b", Some("p"), "r", None, None, Some(dsn), true)
)
}
"which respects --metrics=false" in {
Expand Down

0 comments on commit 415e00a

Please sign in to comment.