Skip to content

Commit 3c705e6

Browse files
- 12 tests failing.
1 parent 42b71b9 commit 3c705e6

16 files changed

+230
-59
lines changed

.vscode/launch.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@
155155
"select JSON_EXTRACT(saml.samlIdentity, '$.username') as saml_username from github.scim.saml_ids saml where saml.org = 'dummyorg';",
156156
"select kind, name, maximumCardsPerInstance from google.compute.acceleratorTypes where project = 'defective-response-content-project' and zone = 'australia-southeast1-a' order by name desc;",
157157
"registry pull google;",
158-
"create materialized view nv as select BackupId, BackupState from aws.cloudhsm.backups where region = 'ap-southeast-2' order by BackupId;"
158+
"create materialized view nv as select BackupId, BackupState from aws.cloudhsm.backups where region = 'ap-southeast-2' order by BackupId;",
159+
"SELECT instance_id FROM aws.ec2.instances WHERE region IN ('us-east-1', 'ap-southeast-2');",
160+
"SELECT instance_id FROM aws.ec2_solid_gold.instances WHERE region IN ('us-east-1', 'ap-southeast-2');",
159161
],
160162
"default": "show providers;"
161163
},
@@ -182,12 +184,13 @@
182184
"type": "pickString",
183185
"id": "authString",
184186
"description": "Auth Input arg String",
185-
"default": "{ \"azure\": { \"type\": \"azure_default\" }, \"digitalocean\": { \"type\": \"bearer\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/digitalocean-key.txt\" }, \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/stackql-security-reviewer.json\" }, \"googleadmin\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/ryuk-it-query.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/okta-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/github-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/aws-secret-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/sumologic-token.txt\", \"type\": \"basic\" } }",
187+
"default": "{}",
186188
"options": [
187189
"{ \"azure\": { \"type\": \"azure_default\" }, \"digitalocean\": { \"type\": \"bearer\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/digitalocean-key.txt\" }, \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/stackql-security-reviewer.json\" }, \"googleadmin\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/ryuk-it-query.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/okta-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/github-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/aws-secret-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/sumologic-token.txt\", \"type\": \"basic\" } }",
188190
"{ \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/google/functional-test-dummy-sa-key.json\" }, \"googleadmin\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/google/functional-test-dummy-sa-key.json\" },s \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/okta/api-key.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/okta/api-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/aws/functional-test-dummy-aws-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/netlify/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/k8s/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/sumologic/sumologic-token.txt\", \"type\": \"basic\" } }",
189191
"{ \"pgi\": { \"type\": \"sql_data_source::postgres\", \"sqlDataSource\": { \"dsn\": \"postgres://stackql:[email protected]:8432\" } }, \"azure\": { \"type\": \"azure_default\" }, \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/stackql-security-reviewer.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/okta-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/github-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/aws-secret-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/sumologic-token.txt\", \"type\": \"basic\" } }",
190-
"{ \"digitalocean\": { \"username_var\": \"DUMMY_DIGITALOCEAN_USERNAME\", \"password_var\": \"DUMMY_DIGITALOCEAN_PASSWORD\", \"type\": \"bearer\" } }"
192+
"{ \"digitalocean\": { \"username_var\": \"DUMMY_DIGITALOCEAN_USERNAME\", \"password_var\": \"DUMMY_DIGITALOCEAN_PASSWORD\", \"type\": \"bearer\" } }",
193+
"{}"
191194
]
192195
},
193196
{
@@ -381,12 +384,7 @@
381384
{
382385
"name": "generic exec",
383386
"type": "go",
384-
"env": {
385-
"DUMMY_DIGITALOCEAN_USERNAME": "myusername",
386-
"DUMMY_DIGITALOCEAN_PASSWORD": "mypassword",
387-
"DD_API_KEY": "myusername",
388-
"DD_APPLICATION_KEY": "mypassword"
389-
},
387+
"envFile": "${workspaceFolder}/.vscode/.env",
390388
"request": "launch",
391389
"mode": "debug",
392390
"program": "${workspaceFolder}/stackql",

docs/walkthroughs/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ in order to setup, run, verify and tear down testing scenarios. The tests *can*
1616

1717
## Running from CI
1818

19-
The canonical, **ruleset-protected** tag form is `scenario-<run_number>-<anything>`. At this stage, `run_number` must refer to a `stackql` run for which a `linux` `amd64` stackql binary archive is present at the time the tag is run.
19+
The canonical, **ruleset-protected** tag form is `scenario-<<run_number>>-<<anything>>`. At this stage, `run_number` must refer to a `stackql` run for which a `linux` `amd64` stackql binary archive is present at the time the tag is run.
2020

2121

22+
## Plumbing
23+
24+
These walkthroughs are runnable using CI. This is built upon:
25+
26+
- `jinja2` templates, with `<<` and `>>` as delimiters.
27+
2228

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
## Setup
3+
4+
First, create a set of AWS CLI credentials per [the AWS documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-authentication-user.html#cli-authentication-user-get), and store them in the appropriate environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
5+
6+
Then, do this in bash:
7+
8+
```bash setup stackql-shell credentials_path=cicd/keys/testing/google-ro-credentials.json app_root_path=./test/tmp/.list-aws-instances.stackql
9+
10+
11+
stackql shell --approot=<<app_root_path>>
12+
```
13+
14+
## Method
15+
16+
Do this in the `stackql` shell, replacing `<<project>>` with your GCP project name, and `<<zone>>` as desired, eg: `australia-southeast1-a`:
17+
18+
```sql stackql-shell input required project=stackql-demo zone=australia-southeast1-a
19+
20+
registry pull aws;
21+
22+
SELECT instance_id, region
23+
FROM aws.ec2.instances
24+
WHERE region IN ('us-east-1', 'eu-west-1');
25+
26+
```
27+
28+
## Result
29+
30+
31+
You will see exactly this included in the output:
32+
33+
```sql expectation stdout-contains-all
34+
|---------------------|-------------------------|
35+
| name | kind |
36+
|---------------------|-------------------------|
37+
| nvidia-tesla-t4-vws | compute#acceleratorType |
38+
|---------------------|-------------------------|
39+
| nvidia-tesla-t4 | compute#acceleratorType |
40+
|---------------------|-------------------------|
41+
| nvidia-tesla-p4-vws | compute#acceleratorType |
42+
|---------------------|-------------------------|
43+
| nvidia-tesla-p4 | compute#acceleratorType |
44+
|---------------------|-------------------------|
45+
```
46+
47+
## Cleanup
48+
49+
```bash teardown best-effort app_root_path=./test/tmp/.list-aws-instances.stackql
50+
51+
rm -rf <<app_root_path>>
52+
53+
```
Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11

22
## Setup
33

4-
First, create a google service account key using the GCP Console, per [the GCP documentation](https://cloud.google.com/iam/docs/keys-create-delete). Grant the service account at least `Viewer` role equivalent privileges, per [the GCP dumentation](https://cloud.google.com/iam/docs/create-service-agents#grant-roles).
4+
First, create a google service account key using the GCP Console, per [the GCP documentation](https://cloud.google.com/iam/docs/keys-create-delete). Grant the service account at least `Viewer` role equivalent privileges, per [the GCP documentation](https://cloud.google.com/iam/docs/create-service-agents#grant-roles).
55

66
Then, do this in bash:
77

8-
```bash setup stackql-shell credentials-path=cicd/keys/testing/google-ro-credentials.json app-root-path=./test/tmp/.get-google-accel.stackql
8+
```bash setup stackql-shell credentials_path=cicd/keys/testing/google-ro-credentials.json app_root_path=./test/tmp/.get-google-accel.stackql
99

10-
export GOOGLE_CREDENTIALS="$(cat <credentials-path>)";
10+
export GOOGLE_CREDENTIALS="$(cat <<credentials_path>>)";
1111

12-
stackql shell --approot=<app-root-path>
12+
stackql shell --approot=<<app_root_path>>
1313
```
1414

1515
## Method
1616

17-
Do this in the `stackql` shell, replacing `<project>` with your GCP project name, and `<zone>` as desired, eg: `australia-southeast1-a`:
17+
Do this in the `stackql` shell, replacing `<<project>>` with your GCP project name, and `<<zone>>` as desired, eg: `australia-southeast1-a`:
1818

1919
```sql stackql-shell input required project=stackql-demo zone=australia-southeast1-a
2020

@@ -25,8 +25,8 @@ select
2525
kind
2626
FROM google.compute.accelerator_types
2727
WHERE
28-
project = '<project>'
29-
AND zone = '<zone>'
28+
project = '<<project>>'
29+
AND zone = '<<zone>>'
3030
ORDER BY
3131
name desc
3232
;
@@ -36,7 +36,7 @@ ORDER BY
3636
## Result
3737

3838

39-
You will see something very much like this included in the output, presuming you have one VM (if you have zero, only the headers should appper, more VMs means more rows):
39+
You will see exactly this included in the output:
4040

4141
```sql expectation stdout-contains-all
4242
|---------------------|-------------------------|
@@ -52,19 +52,10 @@ You will see something very much like this included in the output, presuming you
5252
|---------------------|-------------------------|
5353
```
5454

55-
<!--- EXPECTATION
56-
google\ provider,\ version\ 'v24.11.00274'\ successfully\ installed
57-
goodbye
58-
-->
59-
60-
<x-expectation style="display: none;">
61-
<stdout-contains-nonempty-table></stdout-contains-nonempty-table>
62-
</x-expectation>
63-
6455
## Cleanup
6556

66-
```bash teardown best-effort app-root-path=./test/tmp/.get-google-accel.stackql
57+
```bash teardown best-effort app_root_path=./test/tmp/.get-google-accel.stackql
6758

68-
rm -rf <app-root-path>
59+
rm -rf <<app_root_path>>
6960
7061
```
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11

22
## Setup
33

4-
First, create a google service account key using the GCP Console, per [the GCP documentation](https://cloud.google.com/iam/docs/keys-create-delete). Grant the service account at least `Viewer` role equivalent privileges, per [the GCP dumentation](https://cloud.google.com/iam/docs/create-service-agents#grant-roles).
4+
First, create a google service account key using the GCP Console, per [the GCP documentation](https://cloud.google.com/iam/docs/keys-create-delete). Grant the service account at least `Viewer` role equivalent privileges, per [the GCP documentation](https://cloud.google.com/iam/docs/create-service-agents#grant-roles).
55

66
Then, do this in bash:
77

8-
```bash setup stackql-shell credentials-path=cicd/keys/testing/google-ro-credentials.json app-root-path=./test/tmp/.get-google-vms.stackql
8+
```bash setup stackql-shell credentials_path=cicd/keys/testing/google-ro-credentials.json app_root_path=./test/tmp/.get-google-vms.stackql
99

10-
export GOOGLE_CREDENTIALS="$(cat <credentials-path>)";
10+
export GOOGLE_CREDENTIALS="$(cat <<credentials_path>>)";
1111

12-
stackql shell --approot=<app-root-path>
12+
stackql shell --approot=<<app_root_path>>
1313
```
1414

1515
## Method
1616

17-
Do this in the `stackql` shell, replacing `<project>` with your GCP project name, and `<zone>` as desired, eg: `australia-southeast1-a`:
17+
Do this in the `stackql` shell, replacing `<<project>>` with your GCP project name, and `<<zone>>` as desired, eg: `australia-southeast1-a`:
1818

1919
```sql stackql-shell input required project=stackql-demo zone=australia-southeast1-a
2020

@@ -25,8 +25,8 @@ select
2525
id
2626
FROM google.compute.instances
2727
WHERE
28-
project = '<project>'
29-
AND zone = '<zone>'
28+
project = '<<project>>'
29+
AND zone = '<<zone>>'
3030
;
3131

3232
```
@@ -55,8 +55,8 @@ goodbye
5555

5656
## Cleanup
5757

58-
```bash teardown best-effort app-root-path=./test/tmp/.get-google-vms.stackql
58+
```bash teardown best-effort app_root_path=./test/tmp/.get-google-vms.stackql
5959

60-
rm -rf <app-root-path>
60+
rm -rf <<app_root_path>>
6161
6262
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
|-------------------------|------------------------------------------|
2-
| BucketName | DomainName |
2+
| bucket_name | domain_name |
33
|-------------------------|------------------------------------------|
44
| stackql-trial-bucket-01 | stackql-trial-bucket-01.s3.amazonaws.com |
5-
|-------------------------|------------------------------------------|
5+
|-------------------------|------------------------------------------|

0 commit comments

Comments
 (0)