Skip to content

Commit 4eee90e

Browse files
ci-testing-bolster (#490)
Summary: - Retrospectively added testing for hotfix; robot test case `Default Pagination Behaviour Should Work Correctly Against Straight Array Responses`. - Added CI flags to support development and hotfixes.
1 parent a830625 commit 4eee90e

File tree

7 files changed

+2304
-8
lines changed

7 files changed

+2304
-8
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ env:
2727
GOPRIVATE: github.com/stackql/*
2828
GH_ACCESS_TOKEN: ${{ secrets.ACTIONS_PRIVATE_PACKAGE_SECRET }}
2929
PLANCACHEENABLED: "true"
30+
CI_IS_EXPRESS: ${{ github.ref_type == 'tag' && contains(github.ref_name, 'express') && 'true' || 'false' }}
3031

3132
jobs:
3233

@@ -1167,6 +1168,7 @@ jobs:
11671168
11681169
- name: Build Stackql image with buildx
11691170
uses: docker/build-push-action@v5
1171+
if: ${{ (github.repository == 'stackql/stackql' || github.repository == 'stackql/stackql-devel') }}
11701172
with:
11711173
context: .
11721174
build-args: |
@@ -1175,9 +1177,9 @@ jobs:
11751177
BUILDPATCHVERSION=${{env.BUILDPATCHVERSION}}
11761178
push: false
11771179
target: app
1178-
no-cache: true
1180+
no-cache: ${{ vars.CI_DOCKER_BUILD_NO_CACHE == 'true' && true || false }}
11791181
load: true
1180-
tags: stackql/stackql:${{github.sha}},stackql/stackql:v${{env.BUILDMAJORVERSION}}.${{env.BUILDMINORVERSION}}.${{env.BUILDPATCHVERSION}},stackql/stackql:latest
1182+
tags: ${{ github.repository }}:${{github.sha}},${{ github.repository }}:v${{env.BUILDMAJORVERSION}}.${{env.BUILDMINORVERSION}}.${{env.BUILDPATCHVERSION}},${{ github.repository }}:latest
11811183

11821184
- name: Debug info
11831185
run: |
@@ -1213,13 +1215,13 @@ jobs:
12131215
echo ""
12141216
12151217
- name: Run robot mocked functional tests
1216-
if: success()
1218+
if: success() && env.CI_IS_EXPRESS != 'true'
12171219
timeout-minutes: ${{ vars.DEFAULT_STEP_TIMEOUT_MIN == '' && 20 || vars.DEFAULT_STEP_TIMEOUT_MIN }}
12181220
run: |
12191221
python cicd/python/build.py --robot-test --config='{ "variables": { "EXECUTION_PLATFORM": "docker" } }'
12201222
12211223
- name: Run POSTGRES BACKEND robot mocked functional tests
1222-
if: success()
1224+
if: success() && env.CI_IS_EXPRESS != 'true'
12231225
timeout-minutes: ${{ vars.DEFAULT_STEP_TIMEOUT_MIN == '' && 20 || vars.DEFAULT_STEP_TIMEOUT_MIN }}
12241226
run: |
12251227
echo "## Stray flask apps to be killed before robot tests ##"
@@ -1239,7 +1241,7 @@ jobs:
12391241
python cicd/python/build.py --robot-test --config='{ "variables": { "EXECUTION_PLATFORM": "docker", "SHOULD_RUN_DOCKER_EXTERNAL_TESTS": true, "SQL_BACKEND": "postgres_tcp" } }'
12401242
12411243
- name: Output from mocked functional tests
1242-
if: always()
1244+
if: always() && env.CI_IS_EXPRESS != 'true'
12431245
run: |
12441246
cat ./test/robot/reports/output.xml
12451247
@@ -1268,10 +1270,11 @@ jobs:
12681270
sudo rm -rf cicd/vol/postgres/persist
12691271
12701272
- name: Push stackql image to Docker Hub
1271-
if: ${{ ( success() && github.ref_type == 'branch' && github.ref_name == 'main' && github.repository == 'stackql/stackql' && github.event_name == 'push' ) || ( success() && github.ref_type == 'tag' && startsWith(github.ref_name, 'build-release') ) }}
1273+
if: ${{ (github.repository == 'stackql/stackql' || github.repository == 'stackql/stackql-devel') && vars.CI_SKIP_DOCKER_PUSH != 'true' && ( success() && github.ref_type == 'branch' && github.ref_name == 'main' && github.event_name == 'push' ) || ( success() && github.ref_type == 'tag' && startsWith(github.ref_name, 'build-release') ) }}
12721274
uses: docker/build-push-action@v5
12731275
with:
12741276
context: .
1277+
no-cache: ${{ vars.CI_DOCKER_BUILD_NO_CACHE == 'true' && true || false }}
12751278
platforms: linux/arm64,linux/amd64
12761279
build-args: |
12771280
BUILDMAJORVERSION=${{env.BUILDMAJORVERSION}}
@@ -1280,5 +1283,5 @@ jobs:
12801283
RUN_INTEGRATION_TESTS=0
12811284
push: true
12821285
target: app
1283-
tags: stackql/stackql:${{github.sha}},stackql/stackql:v${{env.BUILDMAJORVERSION}}.${{env.BUILDMINORVERSION}}.${{env.BUILDPATCHVERSION}},stackql/stackql:latest
1286+
tags: ${{ github.repository }}:${{github.sha}},${{ github.repository }}:v${{env.BUILDMAJORVERSION}}.${{env.BUILDMINORVERSION}}.${{env.BUILDPATCHVERSION}},${{ github.repository }}:latest
12841287

cicd/env/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
pyenv/
2+
*.sh

test/python/flask/static_auth/app.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,19 @@ def match_route(self, req: Request) -> dict:
195195
config_path = os.path.join(os.path.dirname(__file__), "expectations.json")
196196
cfg_obj: GetMatcherConfig = GetMatcherConfig()
197197

198+
@app.route('/api/2.0/accounts/<my_account_id>/workspaces', methods=['GET'])
199+
def workspace_list_eccentric(my_account_id: str):
200+
if my_account_id != "contrivedID":
201+
return jsonify({'error': f'Invalid account: {my_account_id}'}), 404
202+
next_page_token = request.args.get('nextPageToken')
203+
if next_page_token:
204+
## is the guard working?
205+
return jsonify({'message': f'disallowed nextPageToken = {next_page_token}'}), 404
206+
rv = make_response(render_template('workspaces-list-01.json', request=request))
207+
rv.headers['Content-Type'] = 'text/plain' # This is key to appropriate testing
208+
rv.status_code = 200
209+
return rv
210+
198211
# A catch-all route that accepts any path
199212
@app.route('/<path:any_path>', methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH'])
200213
def catch_all(any_path):
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[
2+
{
3+
"workspace_id": 10000001,
4+
"workspace_name": "stackql-test",
5+
"aws_region": "us-west-2",
6+
"creation_time": 1734406430000,
7+
"deployment_name": "some-deployment-name",
8+
"workspace_status": "RUNNING",
9+
"account_id": "contrivedID",
10+
"credentials_id": "rubbish-credentials-id",
11+
"storage_configuration_id": "rubbish-storage-configuration-id",
12+
"workspace_status_message": "Workspace is running.",
13+
"is_no_public_ip_enabled": true,
14+
"pricing_tier": "PREMIUM",
15+
"identity_federation_info": {
16+
"enable_identity_federation": true
17+
},
18+
"workspace_info": {
19+
"compliance_security_profile": {
20+
"is_enabled": false
21+
},
22+
"enhanced_security_monitoring": {
23+
"is_enabled": false
24+
}
25+
}
26+
}
27+
]

test/registry/src/stackql_auth_testing/v0.1.0/provider.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ providerServices:
1111
$ref: stackql_auth_testing/v0.1.0/services/collectors.yaml
1212
title: Sumo Logic v1 REST API - users
1313
version: v0.1.0
14+
provisioning:
15+
id: 'provisioning:v0.1.0'
16+
name: provisioning
17+
preferred: true
18+
service:
19+
$ref: stackql_auth_testing/v0.1.0/services/provisioning.yaml
20+
title: Provisioning - Contrived Testing Meterial
21+
version: v0.1.0
22+
description: Provisioning - Totally Contrived Testing Meterial
1423
users:
1524
description: Interact with and view information about users.
1625
id: users:v0.1.0

0 commit comments

Comments
 (0)