Repository navigation
acc: cover tag limits, SQL execution and telemetry upload on cloud, drop the integration equivalents #8072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+399
−415
Merged
acc: cover tag limits, SQL execution and telemetry upload on cloud, drop the integration equivalents #8072
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f6c7ebc
acc: cover tag limits, SQL execution and telemetry upload on cloud, d…
denik 8a1c5cf
Remove Cloud.String, now unused
denik 04f19d4
acc: address review of the backend-libs ports
denik e9b0bd8
acc: use || true for the tag-limits cleanup delete
denik 97d721b
Remove Cloud.NodeTypeID, now unused
denik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
acceptance/experimental/aitools/tools/query/columns-rows/out.test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cloud = true |
11 changes: 11 additions & 0 deletions
11
acceptance/experimental/aitools/tools/query/columns-rows/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
|
|
||
| >>> [CLI] experimental aitools tools query --output csv SELECT id, id * 2 AS doubled FROM range(3) ORDER BY id | ||
| id,doubled | ||
| 0,0 | ||
| 1,2 | ||
| 2,4 | ||
|
|
||
| === statement on the wire | ||
|
|
||
| >>> print_requests.py //api/2.0/sql/statements | ||
| SELECT id, id * 2 AS doubled FROM range(3) ORDER BY id |
4 changes: 4 additions & 0 deletions
4
acceptance/experimental/aitools/tools/query/columns-rows/script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| trace $CLI experimental aitools tools query --output csv "SELECT id, id * 2 AS doubled FROM range(3) ORDER BY id" | ||
|
|
||
| title "statement on the wire" | ||
| trace print_requests.py //api/2.0/sql/statements | jq -r .body.statement |
12 changes: 12 additions & 0 deletions
12
acceptance/experimental/aitools/tools/query/columns-rows/test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| RecordRequests = true | ||
|
|
||
| [[Server]] | ||
| Pattern = "POST /api/2.0/sql/statements" | ||
| Response.Body = ''' | ||
| { | ||
| "statement_id": "s1", | ||
| "status": {"state": "SUCCEEDED"}, | ||
| "manifest": {"schema": {"columns": [{"name": "id"}, {"name": "doubled"}]}, "total_chunk_count": 1}, | ||
| "result": {"data_array": [["0", "0"], ["1", "2"], ["2", "4"]]} | ||
| } | ||
| ''' | ||
1 change: 1 addition & 0 deletions
1
acceptance/experimental/aitools/tools/query/failed-statement/out.test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cloud = true |
6 changes: 6 additions & 0 deletions
6
acceptance/experimental/aitools/tools/query/failed-statement/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| query failed: BAD_REQUEST [TABLE_OR_VIEW_NOT_FOUND], SQLSTATE: 42P01 | ||
|
|
||
| === statement on the wire | ||
|
|
||
| >>> print_requests.py //api/2.0/sql/statements | ||
| SELECT * FROM a_table_that_does_not_exist_zzz |
8 changes: 8 additions & 0 deletions
8
acceptance/experimental/aitools/tools/query/failed-statement/script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # The real message goes on with advice and the workspace's search path; keep the | ||
| # stable parts: error code, error class, the relation and the SQLSTATE. | ||
| musterr $CLI experimental aitools tools query --output csv "SELECT * FROM a_table_that_does_not_exist_zzz" 2> LOG.query | ||
| contains.py 'query failed: BAD_REQUEST [TABLE_OR_VIEW_NOT_FOUND] The table or view `a_table_that_does_not_exist_zzz` cannot be found' 'SQLSTATE: 42P01' < LOG.query > /dev/null | ||
| echo "query failed: BAD_REQUEST [TABLE_OR_VIEW_NOT_FOUND], SQLSTATE: 42P01" | ||
|
|
||
| title "statement on the wire" | ||
| trace print_requests.py //api/2.0/sql/statements | jq -r .body.statement |
17 changes: 17 additions & 0 deletions
17
acceptance/experimental/aitools/tools/query/failed-statement/test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| RecordRequests = true | ||
|
|
||
| [[Server]] | ||
| Pattern = "POST /api/2.0/sql/statements" | ||
| Response.Body = ''' | ||
| { | ||
| "statement_id": "s1", | ||
| "status": { | ||
| "state": "FAILED", | ||
| "sql_state": "42P01", | ||
| "error": { | ||
| "error_code": "BAD_REQUEST", | ||
| "message": "[TABLE_OR_VIEW_NOT_FOUND] The table or view `a_table_that_does_not_exist_zzz` cannot be found. Verify the spelling and correctness of the schema and catalog.\nSearch path: [`system`.`session`, `system`.`builtin`].\nSQLSTATE: 42P01; line 1 pos 14" | ||
| } | ||
| } | ||
| } | ||
| ''' |
1 change: 1 addition & 0 deletions
1
acceptance/experimental/aitools/tools/query/null-parameter/out.test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cloud = true |
9 changes: 9 additions & 0 deletions
9
acceptance/experimental/aitools/tools/query/null-parameter/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| >>> [CLI] experimental aitools tools query --output csv --param maybe= SELECT :maybe IS NULL AS is_null | ||
| is_null | ||
| true | ||
|
|
||
| === statement on the wire | ||
|
|
||
| >>> print_requests.py //api/2.0/sql/statements | ||
| {"statement":"SELECT :maybe IS NULL AS is_null","parameters":[{"name":"maybe"}]} |
5 changes: 5 additions & 0 deletions
5
acceptance/experimental/aitools/tools/query/null-parameter/script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # An empty value is sent without a value, which the API binds as SQL NULL. | ||
| trace $CLI experimental aitools tools query --output csv --param maybe= "SELECT :maybe IS NULL AS is_null" | ||
|
|
||
| title "statement on the wire" | ||
| trace print_requests.py //api/2.0/sql/statements | jq -c '.body | {statement, parameters}' |
12 changes: 12 additions & 0 deletions
12
acceptance/experimental/aitools/tools/query/null-parameter/test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| RecordRequests = true | ||
|
|
||
| [[Server]] | ||
| Pattern = "POST /api/2.0/sql/statements" | ||
| Response.Body = ''' | ||
| { | ||
| "statement_id": "s1", | ||
| "status": {"state": "SUCCEEDED"}, | ||
| "manifest": {"schema": {"columns": [{"name": "is_null"}]}, "total_chunk_count": 1}, | ||
| "result": {"data_array": [["true"]]} | ||
| } | ||
| ''' |
1 change: 1 addition & 0 deletions
1
acceptance/experimental/aitools/tools/query/parameters/out.test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cloud = true |
9 changes: 9 additions & 0 deletions
9
acceptance/experimental/aitools/tools/query/parameters/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| >>> [CLI] experimental aitools tools query --output csv --param n:INT=42 --param s=hello SELECT :n AS n, :s AS s | ||
| n,s | ||
| 42,hello | ||
|
|
||
| === statement on the wire | ||
|
|
||
| >>> print_requests.py //api/2.0/sql/statements | ||
| {"statement":"SELECT :n AS n, :s AS s","parameters":[{"name":"n","type":"INT","value":"42"},{"name":"s","value":"hello"}]} |
4 changes: 4 additions & 0 deletions
4
acceptance/experimental/aitools/tools/query/parameters/script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| trace $CLI experimental aitools tools query --output csv --param n:INT=42 --param s=hello "SELECT :n AS n, :s AS s" | ||
|
|
||
| title "statement on the wire" | ||
| trace print_requests.py //api/2.0/sql/statements | jq -c '.body | {statement, parameters}' |
12 changes: 12 additions & 0 deletions
12
acceptance/experimental/aitools/tools/query/parameters/test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| RecordRequests = true | ||
|
|
||
| [[Server]] | ||
| Pattern = "POST /api/2.0/sql/statements" | ||
| Response.Body = ''' | ||
| { | ||
| "statement_id": "s1", | ||
| "status": {"state": "SUCCEEDED"}, | ||
| "manifest": {"schema": {"columns": [{"name": "n"}, {"name": "s"}]}, "total_chunk_count": 1}, | ||
| "result": {"data_array": [["42", "hello"]]} | ||
| } | ||
| ''' |
1 change: 1 addition & 0 deletions
1
acceptance/experimental/aitools/tools/query/scalar/out.test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cloud = true |
9 changes: 9 additions & 0 deletions
9
acceptance/experimental/aitools/tools/query/scalar/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| >>> [CLI] experimental aitools tools query --output csv SELECT 1 | ||
| 1 | ||
| 1 | ||
|
|
||
| === statement on the wire | ||
|
|
||
| >>> print_requests.py //api/2.0/sql/statements | ||
| SELECT 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| trace $CLI experimental aitools tools query --output csv "SELECT 1" | ||
|
|
||
| title "statement on the wire" | ||
| trace print_requests.py //api/2.0/sql/statements | jq -r .body.statement |
12 changes: 12 additions & 0 deletions
12
acceptance/experimental/aitools/tools/query/scalar/test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| RecordRequests = true | ||
|
|
||
| [[Server]] | ||
| Pattern = "POST /api/2.0/sql/statements" | ||
| Response.Body = ''' | ||
| { | ||
| "statement_id": "s1", | ||
| "status": {"state": "SUCCEEDED"}, | ||
| "manifest": {"schema": {"columns": [{"name": "1"}]}, "total_chunk_count": 1}, | ||
| "result": {"data_array": [["1"]]} | ||
| } | ||
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| require_uc_warehouse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # SQL result types, parameter binding and failures are backend facts: run on every | ||
| # cloud. Locally each case stubs the response the real warehouse returns. | ||
| Cloud = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Called by query/ and statement/. Like the integration tests these replace, the | ||
| # SQL tests run on cloud only on Unity Catalog workspaces with a warehouse: the | ||
| # shared classic warehouses of the non-UC ones are unreliable to start, and | ||
| # CloudEnvs cannot tell azure-prod-ucws from azure-prod. | ||
| require_uc_warehouse() { | ||
| if [ -n "${CLOUD_ENV:-}" ] && { [ -z "${TEST_METASTORE_ID:-}" ] || [ -z "${TEST_DEFAULT_WAREHOUSE_ID:-}" ]; }; then | ||
| echo "SKIP_TEST: needs a Unity Catalog workspace with a warehouse (TEST_METASTORE_ID, TEST_DEFAULT_WAREHOUSE_ID)" | ||
| exit 0 | ||
| fi | ||
| export DATABRICKS_WAREHOUSE_ID=$TEST_DEFAULT_WAREHOUSE_ID | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| require_uc_warehouse |
1 change: 1 addition & 0 deletions
1
acceptance/experimental/aitools/tools/statement/submit-cancel/out.test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cloud = true |
25 changes: 25 additions & 0 deletions
25
acceptance/experimental/aitools/tools/statement/submit-cancel/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
|
|
||
| >>> [CLI] experimental aitools tools statement submit SELECT count(*) FROM range(100000000000) | ||
| { | ||
| "statement_id": "[STATEMENT_ID]", | ||
| "state": "PENDING", | ||
| "warehouse_id": "[TEST_DEFAULT_WAREHOUSE_ID]" | ||
| } | ||
|
|
||
| >>> [CLI] experimental aitools tools statement cancel [STATEMENT_ID] | ||
| { | ||
| "statement_id": "[STATEMENT_ID]", | ||
| "state": "CANCELED" | ||
| } | ||
|
|
||
| >>> [CLI] experimental aitools tools statement get [STATEMENT_ID] | ||
| { | ||
| "statement_id": "[STATEMENT_ID]", | ||
| "state": "CANCELED", | ||
| "error": { | ||
| "message": "statement reached terminal state CANCELED" | ||
| } | ||
| } | ||
|
|
||
| === cancel request | ||
| POST /api/2.0/sql/statements/[STATEMENT_ID]/cancel |
20 changes: 20 additions & 0 deletions
20
acceptance/experimental/aitools/tools/statement/submit-cancel/script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Submit returns at once with a PENDING statement, which the cancel then stops. | ||
| # Locally the testserver's SQL fake tracks the statement and its cancellation. | ||
| trace $CLI experimental aitools tools statement submit "SELECT count(*) FROM range(100000000000)" > out.submit.json | ||
| cat out.submit.json | ||
| STATEMENT_ID=$(jq -r .statement_id out.submit.json) | ||
| add_repl "$STATEMENT_ID" STATEMENT_ID | ||
| rm out.submit.json | ||
|
|
||
| trace $CLI experimental aitools tools statement cancel "$STATEMENT_ID" | ||
|
|
||
| # Cancel is best-effort: a statement that finished before the cancel landed leaves | ||
| # nothing to check. Otherwise get polls to the terminal state, CANCELED. | ||
| if $CLI experimental aitools tools statement get "$STATEMENT_ID" > LOG.get; then | ||
| echo "SKIP_TEST: the statement finished before the cancel landed: $(jq -r .state LOG.get)" | ||
| exit 0 | ||
| fi | ||
| musterr trace $CLI experimental aitools tools statement get "$STATEMENT_ID" | ||
|
|
||
| title "cancel request" | ||
| print_requests.py --summary //cancel |
1 change: 1 addition & 0 deletions
1
acceptance/experimental/aitools/tools/statement/submit-cancel/test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| RecordRequests = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # The statement lifecycle (submit, cancel, terminal state) is a backend fact: run on | ||
| # every cloud. Locally the testserver's SQL fake tracks statements and cancellation. | ||
| Cloud = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cloud = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
|
|
||
| >>> [CLI] pipelines show main.default.missing_table | ||
| Error: statement failed: BAD_REQUEST: unsupported statement: SELECT * FROM `main`.`default`.`missing_table` LIMIT 11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # The testserver fails statements it has no handler for; this pins how the command | ||
| # reports a statement that ends FAILED (the real API's response for that case is | ||
| # pinned on cloud by experimental/aitools/tools/query/failed-statement). | ||
| musterr trace $CLI pipelines show main.default.missing_table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Env.DATABRICKS_WAREHOUSE_ID = "wh-test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cloud = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
|
|
||
| === raw response to two test events | ||
|
|
||
| >>> [CLI] api post /telemetry-ext --json @body.json | ||
| { | ||
| "errors": [], | ||
| "numProtoSuccess": 2 | ||
| } | ||
|
|
||
| === the CLI's own upload | ||
| All 2 logs uploaded successfully |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # The real /telemetry-ext endpoint accepts the CLI's frontend logs. Locally the | ||
| # parent test.toml stubs the endpoint with the same response. | ||
| # A host that disables telemetry would upload nothing. | ||
| unset DATABRICKS_CLI_DISABLE_TELEMETRY | ||
|
|
||
| # A shared workspace can throttle /telemetry-ext past every retry because of other | ||
| # CI runs. That says nothing about whether the endpoint accepts these logs: skip. | ||
| skip_if_throttled() { | ||
| if grep -q 'HTTP/1.1 429' "$1"; then | ||
| echo "SKIP_TEST: /telemetry-ext is rate limited on this workspace" | ||
| exit 0 | ||
| fi | ||
| } | ||
|
|
||
| title "raw response to two test events" | ||
| # The response body as the API returns it: every log a success, an empty error list. | ||
| event() { | ||
| jq -cn --arg id "$(uuid)" --arg name "$1" '{frontend_log_event_id: $id, entry: {databricks_cli_log: {cli_test_event: {name: $name}}}}' | ||
| } | ||
| jq -n --arg a "$(event VALUE1)" --arg b "$(event VALUE2)" --argjson t "$(date +%s)000" \ | ||
| '{uploadTime: $t, items: [], protoLogs: [$a, $b]}' > body.json | ||
| printf "\n>>> [CLI] api post /telemetry-ext --json @body.json\n" | ||
| # Git Bash would rewrite the /telemetry-ext argument as a Windows path. | ||
| if ! MSYS_NO_PATHCONV=1 $CLI api post /telemetry-ext --json @body.json --debug > response.json 2> LOG.api; then | ||
| skip_if_throttled LOG.api | ||
| cat LOG.api >&2 | ||
| exit 1 | ||
| fi | ||
| jq '{errors, numProtoSuccess}' response.json | ||
| rm body.json response.json | ||
|
|
||
| title "the CLI's own upload" | ||
| # The upload makes one attempt per retry, so a throttled endpoint shows up as a 429 | ||
| # in the debug log. A generous timeout avoids a timeout retry. | ||
| export DATABRICKS_CLI_TELEMETRY_TIMEOUT=30 | ||
| $CLI selftest send-telemetry --debug 2> LOG.upload | ||
| if ! grep -q 'uploaded successfully' LOG.upload; then | ||
| skip_if_throttled LOG.upload | ||
| fi | ||
| contains.py 'All 2 logs uploaded successfully' < LOG.upload > /dev/null | ||
| echo "All 2 logs uploaded successfully" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Whether the real endpoint accepts the logs is a backend fact: run on every cloud. | ||
| Cloud = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cloud = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| key with characters outside the pattern: rejected | ||
| key with non-latin1 characters: rejected | ||
| empty key: rejected | ||
| valid key: accepted, stored tags: {"cafe":"value"} | ||
| value café: rejected on aws and gcp, accepted on azure | ||
| value with non-latin1 characters: rejected | ||
| valid value: accepted, stored tags: {"key":"cafe"} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.