Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fjammes committed Jun 16, 2024
1 parent ccc6ed1 commit 4cf62a8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions _e2e/raw2science.out.expected
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
spark-submit --master "k8s://https://127.0.0.1:34729" \
--deploy-mode cluster \
--conf spark.executor.instances=1 \
--conf spark.kubernetes.namespace=default \
--conf spark.kubernetes.authenticate.driver.serviceAccountName=spark \
--conf spark.kubernetes.container.image="param_image" \
Expand Down
5 changes: 3 additions & 2 deletions _e2e/stream2raw.out.expected
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
spark-submit --master "k8s://https://127.0.0.1:34729" \
--deploy-mode cluster \
--conf spark.executor.instances=1 \
--conf spark.kubernetes.namespace=default \
--conf spark.kubernetes.authenticate.driver.serviceAccountName=spark \
--conf spark.kubernetes.container.image="param_image" \
Expand All @@ -15,8 +16,8 @@ spark-submit --master "k8s://https://127.0.0.1:34729" \
--conf spark.hadoop.fs.s3a.impl="org.apache.hadoop.fs.s3a.S3AFileSystem" \
--conf spark.driver.memory=1Gi \
--conf spark.executor.memory=1Gi \
--conf spark.kubernetes.driver.request.cores=1 \
--conf spark.kubernetes.executor.request.cores=1 \
--conf spark.driver.cores=1 \
--conf spark.executor.cores=1 \
local:///home/fink/fink-broker/bin/stream2raw.py \
-log_level "INFO" \
-online_data_prefix "s3a://fink-broker-online-20000101" \
Expand Down
15 changes: 8 additions & 7 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ func applyVarTemplate(template string, night string) string {
return format(template, &TmplData{Night: night})
}

func convertToBytes(input map[string]string) map[string][]byte {
output := make(map[string][]byte)

for key, str := range input {
output[key] = []byte(str)
func convertToBytes(src map[string]string) map[string][]byte {
if src == nil {
return nil
}

return output
dst := make(map[string][]byte, len(src))
for k, v := range src {
dst[k] = []byte(v)
}
return dst
}

0 comments on commit 4cf62a8

Please sign in to comment.