Skip to content

Commit

Permalink
integration test for update dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
bosesuneha committed Mar 22, 2023
1 parent 5f7c508 commit 74816c2
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/gen_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,14 @@ languageVariables:
curl -m 3 \$SERVICEIP:$serviceport
kill \$tunnelPID
- run: ./draft -b main -v generate-workflow -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer
- name: Execute dry run for update command
run: |
mkdir -p test/temp
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ $ingress_test_args
- name: Validate JSON
run: |
npm install -g ajv-cli@5.0.0
ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json
- run: ./draft -v update -d ./langtest/ $ingress_test_args
- name: Check default namespace
if: steps.deploy.outcome != 'success'
Expand Down Expand Up @@ -401,6 +409,14 @@ languageVariables:
curl -m 3 \$SERVICEIP:$serviceport
kill \$tunnelPID
- run: ./draft -v generate-workflow -b main -d ./langtest/ -c someAksCluster -r someRegistry -g someResourceGroup --container-name someContainer
- name: Execute dry run for update command
run: |
mkdir -p test/temp
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ $ingress_test_args
- name: Validate JSON
run: |
npm install -g ajv-cli@5.0.0
ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json
- run: ./draft -v update -d ./langtest/ $ingress_test_args
- name: Check default namespace
if: steps.deploy.outcome != 'success'
Expand Down Expand Up @@ -507,6 +523,14 @@ languageVariables:
curl -m 3 \$SERVICEIP:$serviceport
kill \$tunnelPID
- run: ./draft -v generate-workflow -d ./langtest/ -b main -c someAksCluster -r localhost -g someResourceGroup --container-name testapp
- name: Execute dry run for update command
run: |
mkdir -p test/temp
./draft --dry-run --dry-run-file test/temp/update_dry_run.json update -d ./langtest/ $ingress_test_args
- name: Validate JSON
run: |
npm install -g ajv-cli@5.0.0
ajv validate -s test/update_dry_run_schema.json -d test/temp/update_dry_run.json
- uses: actions/upload-artifact@v3
with:
name: $lang-manifests-create
Expand Down
71 changes: 71 additions & 0 deletions test/update_dry_run_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/object1670282842.json",
"title": "Root",
"type": "object",
"properties": {
"variables": {
"$id": "#root/variables",
"title": "Variables",
"type": "object",
"properties": {
"ingress-host": {
"$id": "#root/variables/ingress-host",
"title": "IngressHost",
"type": "string",
"default": "",
"pattern": "^.*$"
},
"ingress-tls-cert-keyvault-uri": {
"$id": "#root/variables/ingress-tls-cert-keyvault-uri",
"title": "IngressTlsCertKeyvaultUri",
"type": "string",
"default": "",
"pattern": "^.*$"
},
"ingress-use-osm-mtls": {
"$id": "#root/variables/ingress-use-osm-mtls",
"title": "IngressUseOsmMtls",
"type": "string",
"default": "",
"pattern": "^.*$"
},
"service-name": {
"$id": "#root/variables/service-name",
"title": "ServiceName",
"type": "string",
"default": "",
"pattern": "^.*$"
},
"service-namespace": {
"$id": "#root/variables/service-namespace",
"title": "ServiceNamespace",
"type": "string",
"default": "",
"pattern": "^.*$"
},
"service-port": {
"$id": "#root/variables/service-port",
"title": "ServicePort",
"type": "string",
"default": "",
"pattern": "^.*$"
}
}
},
"filesToWrite": {
"$id": "#root/filesToWrite",
"title": "FilesToWrite",
"type": "array",
"default": [],
"items": {
"$id": "#root/filesToWrite/items",
"title": "Items",
"type": "string",
"default": "",
"pattern": "^.*$"
}
}
}
}

0 comments on commit 74816c2

Please sign in to comment.