Skip to content

Commit b920758

Browse files
- Added robot test Materialized View of Filtered Multi Level Table Valued Function In Subquery Returns Expected Results.
1 parent 179d432 commit b920758

File tree

8 files changed

+1828
-7
lines changed

8 files changed

+1828
-7
lines changed

cicd/scripts/context.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
3+
CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}")" && pwd)"
44

55
export REPOSITORY_ROOT="$(realpath ${CUR_DIR}/../..)"
66

cicd/scripts/testing-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
3+
CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}")" && pwd)"
44

55
source "${CUR_DIR}/context.sh"
66

cicd/util/01-build-robot-lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ checkPoetry () {
88
fi
99
}
1010

11-
CURDIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
11+
CURDIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-${(%):-%x}}" )" &> /dev/null && pwd )"
1212

1313
REPOSITORY_ROOT="$(realpath ${CURDIR}/../..)"
1414

cicd/util/02-install-robot-lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#! /usr/bin/env bash
22

3-
CURDIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
3+
CURDIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-${(%):-%x}}" )" &> /dev/null && pwd )"
44

55
REPOSITORY_ROOT="$(realpath ${CURDIR}/../..)"
66

77
PACKAGE_ROOT="${REPOSITORY_ROOT}/test"
88

99
venv_path="${REPOSITORY_ROOT}/.venv"
1010

11-
CURDIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
11+
CURDIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-${(%):-%x}}" )" &> /dev/null && pwd )"
1212

1313
REPOSITORY_ROOT="$(realpath ${CURDIR}/../..)"
1414

docs/analytics.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,54 @@ Robot tests for:
2121

2222
```sql
2323

24+
-- sqlite version
25+
26+
CREATE OR REPLACE MATERIALIZED VIEW gcp_compute_public_ip_exposure AS
27+
select
28+
resource_type,
29+
resource_id,
30+
resource_name,
31+
cloud,
32+
region,
33+
protocol,
34+
from_port,
35+
to_port,
36+
cidr,
37+
direction,
38+
public_access_type,
39+
public_principal,
40+
access_mechanism
41+
from
42+
(
43+
SELECT
44+
'compute' AS resource_type,
45+
vms.id AS resource_id,
46+
vms.name AS resource_name,
47+
'google' AS cloud,
48+
split_part(vms.zone, '/', -1) AS region,
49+
NULL AS protocol,
50+
NULL AS from_port,
51+
NULL AS to_port,
52+
NULL AS cidr,
53+
NULL AS direction,
54+
NULL AS public_access_type,
55+
NULL AS public_principal,
56+
NULL AS access_mechanism,
57+
json_extract(ac.value, '$.natIP') as external_ip
58+
FROM google.compute.instances vms,
59+
json_each(vms.networkInterfaces) AS ni,
60+
json_each(json_extract(ni.value, '$.accessConfigs')) AS ac
61+
WHERE
62+
vms.project in (
63+
'testing-project'
64+
)
65+
) foo
66+
where external_ip != ''
67+
;
68+
69+
70+
-- postgres version
71+
2472
CREATE OR REPLACE MATERIALIZED VIEW gcp_compute_public_ip_exposure AS
2573
select
2674
resource_type,
@@ -58,8 +106,7 @@ FROM google.compute.instances vms,
58106
json_array_elements_text(json_extract_path_text(ni.value, 'accessConfigs')) AS ac
59107
WHERE
60108
vms.project in (
61-
'stackql-demo',
62-
'stackql-robot'
109+
'stackql-interesting'
63110
)
64111
) foo
65112
where external_ip != ''

test/python/stackql_test_tooling/flask/gcp/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ def projects_testing_project_zones_australia_southeast1_a_instances():
290290
def projects_testing_project_aggregated_instances():
291291
return render_template('route_30_template.json'), 200, {'Content-Type': 'application/json'}
292292

293+
@app.route('/compute/v1/projects/stackql-interesting/aggregated/instances', methods=['GET'])
294+
def projects_stackql_interesting_aggregated_instances():
295+
return render_template('instances-agg-list-interesting.jinja.json'), 200, {'Content-Type': 'application/json'}
296+
293297
assets_counter = {'count': 0}
294298
@app.route('/v1/projects/testing-project/assets', methods=['GET'])
295299
def v1_projects_testing_project_assets():

0 commit comments

Comments
 (0)