|
19 | 19 | GH_ACCESS_TOKEN: ${{ secrets.ACTIONS_PRIVATE_PACKAGE_SECRET }}
|
20 | 20 | PLANCACHEENABLED: "true"
|
21 | 21 | GOLANG_VERSION: 1.22
|
| 22 | + STACKQL_CORE_REPOSITORY: ${{ vars.STACKQL_CORE_REPOSITORY != '' && vars.STACKQL_CORE_REPOSITORY || 'stackql/stackql' }} |
| 23 | + STACKQL_CORE_REF: ${{ vars.STACKQL_CORE_REF != '' && vars.STACKQL_CORE_REF || 'main' }} |
22 | 24 |
|
23 | 25 | jobs:
|
24 | 26 |
|
|
92 | 94 |
|
93 | 95 | - name: Check out code into the Go module directory
|
94 | 96 | uses: actions/checkout@v2
|
| 97 | + |
| 98 | + - name: Setup Python |
| 99 | + |
| 100 | + with: |
| 101 | + cache: pip |
| 102 | + python-version: '3.11' |
95 | 103 |
|
96 | 104 | - name: Get dependencies
|
97 | 105 | run: |
|
@@ -124,17 +132,57 @@ jobs:
|
124 | 132 | if: success()
|
125 | 133 | run: go test -timeout 240s -v ./...
|
126 | 134 |
|
127 |
| - - name: CLI Test |
| 135 | + - name: Trivial CLI Test |
128 | 136 | if: success()
|
129 | 137 | run: |
|
130 | 138 | sudo apt-get update
|
131 | 139 | sudo apt-get install -y jq
|
132 | 140 | result="$(build/anysdk const | jq -r '.ExtensionKeyAlwaysRequired')"
|
133 | 141 | if [ "$result" != "x-alwaysRequired" ]; then
|
134 |
| - echo "CLI Test Failed with unexpected result: $result" |
| 142 | + echo "Trivial CLI Test Failed with unexpected result: $result" |
| 143 | + exit 1 |
| 144 | + else |
| 145 | + echo "Trivial CLI Test passed with expected result: $result" |
| 146 | + fi |
| 147 | +
|
| 148 | + - name: Download core |
| 149 | + uses: actions/checkout@v2 |
| 150 | + with: |
| 151 | + repository: ${{ env.STACKQL_CORE_REPOSITORY }} |
| 152 | + ref: ${{ env.STACKQL_CORE_REF }} |
| 153 | + path: stackql-core |
| 154 | + |
| 155 | + - name: Create materials for core tests |
| 156 | + working-directory: stackql-core |
| 157 | + run: | |
| 158 | + pip3 install -r cicd/requirements.txt |
| 159 | + openssl req -x509 -keyout test/server/mtls/credentials/pg_server_key.pem -out test/server/mtls/credentials/pg_server_cert.pem -config test/server/mtls/openssl.cnf -days 365 |
| 160 | + openssl req -x509 -keyout test/server/mtls/credentials/pg_client_key.pem -out test/server/mtls/credentials/pg_client_cert.pem -config test/server/mtls/openssl.cnf -days 365 |
| 161 | + openssl req -x509 -keyout test/server/mtls/credentials/pg_rubbish_key.pem -out test/server/mtls/credentials/pg_rubbish_cert.pem -config test/server/mtls/openssl.cnf -days 365 |
| 162 | + python3 test/python/registry-rewrite.py |
| 163 | + |
| 164 | + - name: Start Core Test Mocks |
| 165 | + working-directory: stackql-core |
| 166 | + run: | |
| 167 | + pgrep -f flask | xargs kill -9 |
| 168 | + flask --app=./test/python/flask/gcp/app run --cert=./test/server/mtls/credentials/pg_server_cert.pem --key=./test/server/mtls/credentials/pg_server_key.pem --port 1080 & |
| 169 | + |
| 170 | + - name: Run core mocked testing |
| 171 | + working-directory: stackql-core |
| 172 | + run: | |
| 173 | + bucketsListIDs="$(./build/anysdk query \ |
| 174 | + --svc-file-path="test/registry-mocked/src/googleapis.com/v0.1.2/services/storage-v1.yaml" \ |
| 175 | + --prov-file-path="test/registry-mocked/src/googleapis.com/v0.1.2/provider.yaml" \ |
| 176 | + --resource buckets \ |
| 177 | + --method list \ |
| 178 | + --parameters '{ "project": "stackql-demo" }' \ |
| 179 | + | jq -r '.items[].id')" |
| 180 | + matchingBuckets="$(echo "${bucketsListIDs}" | grep "stackql-demo" )" |
| 181 | + if [ "${matchingBuckets}" = "" ]; then |
| 182 | + echo "Core Test Failed with no matchinh buckets" |
135 | 183 | exit 1
|
136 | 184 | else
|
137 |
| - echo "CLI Test passed with expected result: $result" |
| 185 | + echo "Core Test passed with matching buckets: $matchingBuckets" |
138 | 186 | fi
|
139 | 187 |
|
140 | 188 | macosbuild:
|
|
0 commit comments