add integration test

This commit is contained in:
Shreyas Goenka 2025-02-24 16:59:17 +01:00
parent 9e3aa59293
commit 00ebbb9c47
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
14 changed files with 64 additions and 5 deletions

View File

@ -1,5 +1,3 @@
LocalOnly = true
RecordRequests = true
IncludeRequestHeaders = ["Authorization"] IncludeRequestHeaders = ["Authorization"]
[[Repls]] [[Repls]]

View File

@ -1,3 +1,3 @@
Telemetry logs uploaded successfully Telemetry logs uploaded successfully
Response: Response:
{"errors":null,"numProtoSuccess":2} {"errors":[],"numProtoSuccess":2}

View File

@ -1,7 +1,11 @@
LocalOnly = true
RecordRequests = true
[[Server]] [[Server]]
Pattern = "POST /telemetry-ext" Pattern = "POST /telemetry-ext"
Response.Body = ''' Response.Body = '''
{ {
"errors": [],
"numProtoSuccess": 2 "numProtoSuccess": 2
} }
''' '''

View File

@ -1,3 +1,6 @@
LocalOnly = true
RecordRequests = true
[[Server]] [[Server]]
Pattern = "POST /telemetry-ext" Pattern = "POST /telemetry-ext"
Response.Body = ''' Response.Body = '''

View File

@ -1,7 +1,11 @@
LocalOnly = true
RecordRequests = true
[[Server]] [[Server]]
Pattern = "POST /telemetry-ext" Pattern = "POST /telemetry-ext"
Response.Body = ''' Response.Body = '''
{ {
"errors": [],
"numProtoSuccess": 2 "numProtoSuccess": 2
} }
''' '''

View File

@ -0,0 +1,3 @@
Telemetry logs uploaded successfully
Response:
{"errors":[],"numProtoSuccess":2}

View File

@ -0,0 +1,5 @@
>>> [CLI] selftest send-telemetry
waiting for telemetry process to finish
hello
[wait_pid] process has ended

View File

@ -0,0 +1,14 @@
export DATABRICKS_CLI_TELEMETRY_PID_FILE=./telemetry.pid
export DATABRICKS_CLI_TELEMETRY_UPLOAD_LOGS_FILE=./out.upload_process.txt
trace $CLI selftest send-telemetry
echo "waiting for telemetry process to finish"
echo "hello"
# Wait for the child telemetry process to finish
wait_pid $(cat ./telemetry.pid)
# cleanup the pid file
rm -f ./telemetry.pid

View File

@ -0,0 +1,16 @@
# RecordRequests is not supported for integration tests yet. Once we have support
# for running integration tests with record requests we can remove this test since
# it's a copy of acceptance/telemetry/upload-succeeds.
[[Server]]
Pattern = "POST /telemetry-ext"
Response.Body = '''
{
"errors": [],
"numProtoSuccess": 2
}
'''
[[Repls]]
Old = 'execution_time_ms\\\":\d{1,5},'
New = 'execution_time_ms\":\"SMALL_INT\",'

View File

@ -1,3 +1,3 @@
Telemetry logs uploaded successfully Telemetry logs uploaded successfully
Response: Response:
{"errors":null,"numProtoSuccess":2} {"errors":[],"numProtoSuccess":2}

View File

@ -1,7 +1,11 @@
LocalOnly = true
RecordRequests = true
[[Server]] [[Server]]
Pattern = "POST /telemetry-ext" Pattern = "POST /telemetry-ext"
Response.Body = ''' Response.Body = '''
{ {
"errors": [],
"numProtoSuccess": 2 "numProtoSuccess": 2
} }
''' '''

View File

@ -1,3 +1,3 @@
Telemetry logs uploaded successfully Telemetry logs uploaded successfully
Response: Response:
{"errors":null,"numProtoSuccess":2} {"errors":[],"numProtoSuccess":2}

View File

@ -1,7 +1,11 @@
LocalOnly = true
RecordRequests = true
[[Server]] [[Server]]
Pattern = "POST /telemetry-ext" Pattern = "POST /telemetry-ext"
Response.Body = ''' Response.Body = '''
{ {
"errors": [],
"numProtoSuccess": 2 "numProtoSuccess": 2
} }
''' '''

View File

@ -1,7 +1,11 @@
LocalOnly = true
RecordRequests = true
[[Server]] [[Server]]
Pattern = "POST /telemetry-ext" Pattern = "POST /telemetry-ext"
Response.Body = ''' Response.Body = '''
{ {
"errors": [],
"numProtoSuccess": 2 "numProtoSuccess": 2
} }
''' '''