Skip to content

Commit

Permalink
Fix helm test (automated api call tests) to use new api AAS 3
Browse files Browse the repository at this point in the history
  • Loading branch information
tunacicek committed Jul 17, 2023
1 parent 0fbf496 commit 0806da7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/helm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:

- name: Kubernetes KinD Cluster
uses: container-tools/kind-action@v1
with:
# upgrade version, default (v0.17.0) uses node image v1.21.1 and doesn't work with more recent node image versions
version: v0.19.0
# default value for event_name != workflow_dispatch
node_image: ${{ github.event.inputs.node_image || 'kindest/node:v1.24.6' }}

- name: Build image
uses: docker/build-push-action@v3
Expand Down Expand Up @@ -61,7 +66,7 @@ jobs:
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: ct lint --validate-maintainers=false --target-branch ${{ github.event.repository.default_branch }} --config charts/chart-testing-config.yaml
Expand Down
2 changes: 1 addition & 1 deletion charts/registry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: registry
description: Tractus-X Digital Twin Registry Helm Chart

type: application
version: 0.3.10
version: 0.3.11
appVersion: 0.3.9-M1

dependencies:
Expand Down
5 changes: 2 additions & 3 deletions charts/registry/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ spec:
containers:
- name: test-container
image: python:3.8-slim
workingDir: /tests
command: ['./test-script.sh']
securityContext:
runAsUser: 100
allowPrivilegeEscalation: false
workingDir: /tests
command: ['./test-script.sh']
volumeMounts:
- name: test-script
mountPath: /tests
Expand Down
29 changes: 15 additions & 14 deletions charts/registry/templates/tests/test-script-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ data:
stages:
- name: Test get shell descriptors without access token
request:
url: "{aas_registry_api_url:s}/registry/shell-descriptors"
url: "{aas_registry_api_url:s}/api/v3.0/shell-descriptors"
method: GET
response:
status_code: 401
Expand All @@ -72,7 +72,7 @@ data:
- name: Authenticated request
request:
url: "{aas_registry_api_url:s}/registry/shell-descriptors"
url: "{aas_registry_api_url:s}/api/v3.0/shell-descriptors"
method: GET
headers:
Content-Type: application/json
Expand All @@ -95,25 +95,25 @@ data:
- name: Create shell descriptor expect success
request:
url: "{aas_registry_api_url:s}/registry/shell-descriptors"
url: "{aas_registry_api_url:s}/api/v3.0/shell-descriptors"
method: POST
headers:
Content-Type: application/json
Authorization: "Bearer {access_token}"
json:
identification: !uuid
id: !uuid
idShort: twin of a break (Testing)
response:
status_code: 201
headers:
content-type: application/json
save:
json:
returned_identification: identification
returned_id: id
- name: Get shell descriptor by identification
- name: Get shell descriptor by id
request:
url: "{aas_registry_api_url:s}/registry/shell-descriptors/{returned_identification:s}"
url: "{aas_registry_api_url:s}/api/v3.0/shell-descriptors/{returned_id:s}"
method: GET
headers:
Content-Type: application/json
Expand All @@ -123,28 +123,29 @@ data:
headers:
content-type: application/json
json:
identification: "{returned_identification:s}"
idShort: twin of a break (Testing)
description: []
displayName: []
idShort: twin of a break (Testing)
id: "{returned_id:s}"
specificAssetIds: []
submodelDescriptors: []
- name: Update shell descriptor by identification
- name: Update shell descriptor by id
request:
url: "{aas_registry_api_url:s}/registry/shell-descriptors/{returned_identification:s}"
url: "{aas_registry_api_url:s}/api/v3.0/shell-descriptors/{returned_id:s}"
method: PUT
headers:
Content-Type: application/json
Authorization: "Bearer {access_token}"
json:
identification: "{returned_identification:s}"
id: "{returned_id:s}"
idShort: twin of a break (Testing Update)
response:
status_code: 204
- name: Delete shell descriptor by identification
- name: Delete shell descriptor by id
request:
url: "{aas_registry_api_url:s}/registry/shell-descriptors/{returned_identification:s}"
url: "{aas_registry_api_url:s}/api/v3.0/shell-descriptors/{returned_id:s}"
method: DELETE
headers:
Content-Type: application/json
Expand Down

0 comments on commit 0806da7

Please sign in to comment.