Skip to content

Commit d7ae333

Browse files
authored
log engine database and transaction id (#105)
1 parent d12f49b commit d7ae333

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/integration.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ rnd_test_name() = "julia-sdk-" * string(UUIDs.uuid4())
5555
# finished. An already existing engine can be supplied to improve local iteration times.
5656
function with_engine(f, ctx; existing_engine=nothing)
5757
engine_name = rnd_test_name()
58+
@info "engine: $engine_name"
5859
if isnothing(existing_engine)
5960
custom_headers = get(ENV, "CUSTOM_HEADERS", nothing)
6061
start_time = time()
@@ -96,6 +97,7 @@ end
9697
# iteration times.
9798
function with_database(f, ctx; existing_database=nothing)
9899
dbname = rnd_test_name()
100+
@info "database: $dbname"
99101
isnothing(existing_database) &&
100102
create_database(ctx, dbname)
101103
try
@@ -155,6 +157,7 @@ with_engine(CTX) do engine_name
155157
query_string = "x, x^2, x^3, x^4 from x in {1; 2; 3; 4; 5}"
156158
resp = exec(CTX, database_name, engine_name, query_string)
157159

160+
@info "transaction id: $(resp.transaction[:id])"
158161
# transaction
159162
@test resp.transaction[:state] == "COMPLETED"
160163

@@ -187,6 +190,7 @@ with_engine(CTX) do engine_name
187190
@testset "exec_async" begin
188191
query_string = "x, x^2, x^3, x^4 from x in {1; 2; 3; 4; 5}"
189192
resp = exec_async(CTX, database_name, engine_name, query_string)
193+
@info "transaction id: $(resp.transaction[:id])"
190194
resp = wait_until_done(CTX, resp)
191195
txn = resp.transaction
192196

@@ -243,6 +247,8 @@ with_engine(CTX) do engine_name
243247
csv_data,
244248
)
245249

250+
@info "transaction id: $(resp.transaction[:id])"
251+
246252
@test resp.transaction[:state] == "COMPLETED"
247253

248254
results = Dict(
@@ -273,13 +279,15 @@ with_engine(CTX) do engine_name
273279
@testset "empty arrow file" begin
274280
query_string = "def output = true"
275281
resp = exec(CTX, database_name, engine_name, query_string)
282+
@info "transaction id: $(resp.transaction[:id])"
276283
@test show_result_str(resp) === """[:output]
277284
()
278285
"""
279286
end
280287
@testset "multiple physical relations" begin
281288
query_string = ":a, 1; :b, 2,3; :b, 4,5"
282289
resp = exec(CTX, database_name, engine_name, query_string)
290+
@info "transaction id: $(resp.transaction[:id])"
283291
@test show_result_str(resp) === """[:output, :a, Int64]
284292
(1,)
285293
@@ -300,6 +308,7 @@ with_engine(CTX) do engine_name
300308

301309
models = Dict("test_model" => "def foo = :bar")
302310
resp = load_models(CTX, database_name, engine_name, models)
311+
@info "transaction id: $(resp.transaction[:id])"
303312
@test resp.transaction.state == "COMPLETED"
304313

305314
value = get_model(CTX, database_name, engine_name, "test_model")
@@ -309,6 +318,7 @@ with_engine(CTX) do engine_name
309318
@test "test_model" in models
310319

311320
resp = delete_models(CTX, database_name, engine_name, ["test_model"])
321+
@info "transaction id: $(resp.transaction[:id])"
312322
@test resp.transaction.state == "COMPLETED"
313323
@test length(resp.problems) == 0
314324

@@ -318,6 +328,7 @@ with_engine(CTX) do engine_name
318328
# test escape special rel character
319329
models = Dict("percent" => "def foo = \"98%\"")
320330
resp = load_models(CTX, database_name, engine_name, models)
331+
@info "transaction id: $(resp.transaction[:id])"
321332
@test resp.transaction.state == "COMPLETED"
322333
@test length(resp.problems) > 0
323334
resp = delete_models(CTX, database_name, engine_name, ["percent"])
@@ -326,6 +337,7 @@ with_engine(CTX) do engine_name
326337

327338
models = Dict("percent" => "def foo = \"98\\%\"")
328339
resp = load_models(CTX, database_name, engine_name, models)
340+
@info "transaction id: $(resp.transaction[:id])"
329341
@test resp.transaction.state == "COMPLETED"
330342
@test length(resp.problems) == 0
331343
value = get_model(CTX, database_name, engine_name, "percent")
@@ -335,6 +347,7 @@ with_engine(CTX) do engine_name
335347
@test "percent" in models
336348

337349
resp = delete_models(CTX, database_name, engine_name, ["percent"])
350+
@info "transaction id: $(resp.transaction[:id])"
338351
@test resp.transaction.state == "COMPLETED"
339352
@test length(resp.problems) == 0
340353

@@ -344,6 +357,7 @@ with_engine(CTX) do engine_name
344357
# test escape """
345358
models = Dict("triple_quoted" => "def foo = \"\"\"98\\%\"\"\" ")
346359
resp = load_models(CTX, database_name, engine_name, models)
360+
@info "transaction id: $(resp.transaction[:id])"
347361
@test resp.transaction.state == "COMPLETED"
348362
@test length(resp.problems) == 0
349363
value = get_model(CTX, database_name, engine_name, "triple_quoted")
@@ -354,6 +368,7 @@ with_engine(CTX) do engine_name
354368
@test length(resp.problems) == 0
355369

356370
resp = delete_models(CTX, database_name, engine_name, ["triple_quoted"])
371+
@info "transaction id: $(resp.transaction[:id])"
357372
@test resp.transaction.state == "COMPLETED"
358373
@test length(resp.problems) == 0
359374

0 commit comments

Comments
 (0)