Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm acceptance tests #2002

Merged
merged 40 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f458dad
Initial work
May 11, 2021
11b1bb8
Fix test Dockerfile pointing to flag that does not exist (#1973)
May 12, 2021
ebfbf87
Fix service endpoint migration (#1974) (#1978)
Nana-EC May 13, 2021
6a1a753
Signature consensus ratio config (#1950)
Nana-EC May 14, 2021
2fd45c5
Fix using wrapper chart without redis chart enabled (#1980)
steven-sheehy May 14, 2021
ff07562
Bump grpc.version from 1.37.0 to 1.37.1 (#1987)
dependabot[bot] May 17, 2021
70d6b56
Bump protobuf-java from 3.16.0 to 3.17.0 (#1991)
dependabot[bot] May 17, 2021
eb5e521
Bump frontend-maven-plugin from 1.11.3 to 1.12.0 (#1988)
dependabot[bot] May 17, 2021
183f2e4
Bump software.amazon.awssdk:bom from 2.16.59 to 2.16.63 (#1990)
dependabot[bot] May 17, 2021
3bbe810
Bump embedded.testcontainers.version from 2.0.7 to 2.0.8 (#1994)
dependabot[bot] May 17, 2021
b6a93d4
Bump jackson-dataformat-msgpack from 0.8.22 to 0.8.24 (#1995)
dependabot[bot] May 17, 2021
7ed0efd
Bump cucumber.version from 6.10.3 to 6.10.4 (#1989)
dependabot[bot] May 17, 2021
e6ff621
Bump mathjs in /hedera-mirror-rest/monitoring/monitor_apis (#1982)
dependabot[bot] May 17, 2021
ccdd510
Bump mathjs from 9.3.2 to 9.4.0 in /hedera-mirror-rest (#1986)
dependabot[bot] May 17, 2021
1df680a
Add alertmanager inhibit rules (#1925)
May 17, 2021
acfccd3
Remove JMeter based performance tests (#1981)
steven-sheehy May 17, 2021
60b92cd
Fix pgpool admin password (#1998)
steven-sheehy May 18, 2021
fdbc2a4
Bump aws-sdk from 2.904.0 to 2.907.0 in /hedera-mirror-rest (#1984)
dependabot[bot] May 18, 2021
9be6d0e
Bump eslint-plugin-import from 2.22.1 to 2.23.2 in /hedera-mirror-res…
dependabot[bot] May 18, 2021
7c7c3e1
Add NFT Design Doc (#1845)
May 19, 2021
4616eb7
Bump versions for v0.35.0-SNAPSHOT (#1999)
hedera-github-bot May 19, 2021
dbb1d46
Add pod and secret for acceptance tests
May 19, 2021
69e3541
Cleaning up templates, adding config
May 21, 2021
a63a8a9
Change cucumber tags to template
May 21, 2021
b04ae23
Make env into volume
May 21, 2021
162878d
Fix templates
May 24, 2021
4071ea3
More template fixes
May 24, 2021
1e634a4
Stop the restart
May 24, 2021
ac97392
Add values.yaml and README
May 24, 2021
6305a3e
Fix README
May 24, 2021
ce4bc20
Fix README
May 24, 2021
5126fef
Disable test by default
May 24, 2021
0315456
Merge with master
May 24, 2021
05f9e27
Fix README
May 24, 2021
1a34249
Reorder values.yaml
May 24, 2021
8ae6a81
Change test pod name to acceptance-test
May 24, 2021
5ed0dd3
Fix rest base url
May 25, 2021
668e54c
Add retrieveAddressBook config
May 25, 2021
19175e3
Adding comments
May 25, 2021
34c0149
PR Comments
May 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,30 @@ When deploying in GCP, the following steps may be taken to use container-native
## Testing

To verify the chart installation is successful, you can run the helm tests. These tests are not automatically executed
by helm on install/upgrade, they have to be executed manually:
by helm on install/upgrade, they have to be executed manually. The tests require the `existingTopicNum`, `operatorId`,
and `operatorKey` properties be set in a local values file in order to execute, as well as `network` if using an environment other
than testnet, and `nodes` if using a custom environment.

To configure:

```yaml
test:
config:
hedera:
mirror:
test:
acceptance:
existingTopicNum:
network:
# Do not use use 0.0.2 or 0.0.50 for operator to ensure crypto transfers are not waived
operatorId:
operatorKey:
```

To execute:

```shell script
helm test "${RELEASE}"
helm test "${RELEASE} " --timeout 10m
```

## Using
Expand Down
35 changes: 35 additions & 0 deletions charts/hedera-mirror/templates/tests/pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{- if .Values.test.enabled -}}
apiVersion: v1
kind: Pod
metadata:
labels: {{- include "hedera-mirror.labels" . | nindent 4 }}
name: {{ include "hedera-mirror.fullname" . }}-acceptance-test
namespace: {{ include "hedera-mirror.namespace" . }}
annotations:
helm.sh/hook: test
helm.sh/hook-delete-policy: hook-failed,hook-succeeded
spec:
containers:
- name: acceptance-tests
image: "{{ .Values.test.image.repository }}:{{ .Values.test.image.tag | default .Chart.AppVersion }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also use the global.image.tag. You'll need to add a global.image: {} to the values.yaml.

Suggested change
image: "{{ .Values.test.image.repository }}:{{ .Values.test.image.tag | default .Chart.AppVersion }}"
image: "{{ .Values.test.image.repository }}:{{ .Values.global.image.tag | default .Values.test.image.tag | default .Chart.AppVersion }}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, added that.

imagePullPolicy: {{ .Values.test.image.pullPolicy }}
command:
- 'sh'
- '-c'
- |
Nana-EC marked this conversation as resolved.
Show resolved Hide resolved
cp /etc/secrets/* /usr/etc/hedera-mirror-node/hedera-mirror-test/src/test/resources/
find /usr/etc/hedera-mirror-node/hedera-mirror-test/src/test/resources/
cat /usr/etc/hedera-mirror-node/hedera-mirror-test/src/test/resources/*.yml
./mvnw integration-test --projects hedera-mirror-test/ -P=acceptance-tests -Dcucumber.filter.tags={{ .Values.test.cucumberTags }}
volumeMounts:
- name: acceptance-tests
mountPath: /etc/secrets
readOnly: true
restartPolicy: Never
terminationGracePeriodSeconds: 1
volumes:
- name: acceptance-tests
secret:
defaultMode: 420
secretName: {{ include "hedera-mirror.fullname" . }}-acceptance-test
{{- end -}}
16 changes: 16 additions & 0 deletions charts/hedera-mirror/templates/tests/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.test.enabled -}}
apiVersion: v1
kind: Secret
metadata:
labels: {{ include "hedera-mirror.labels" . | nindent 4 }}
name: {{ include "hedera-mirror.fullname" . }}-acceptance-test
namespace: {{ include "hedera-mirror.namespace" . }}
annotations:
helm.sh/hook: test
helm.sh/hook-delete-policy: hook-failed,hook-succeeded

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

type: Opaque
stringData:
application-default.yml: |-
{{- tpl (toYaml .Values.test.config) $ | nindent 4 }}
{{- end -}}
21 changes: 21 additions & 0 deletions charts/hedera-mirror/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,27 @@ rest:
name: mirror-passwords
key: HEDERA_MIRROR_IMPORTER_DB_RESTUSERNAME

test:
config:
hedera:
mirror:
test:
acceptance:
existingTopicNum:
# grpc endpoint
mirrorNodeAddress: "{{ .Release.Name }}-grpc:5600"
network:
# Do not use use 0.0.2 or 0.0.50 for operator to ensure crypto transfers are not waived
operatorId:
operatorKey:
Nana-EC marked this conversation as resolved.
Show resolved Hide resolved
restBaseUrl: "http://{{ .Release.Name }}-rest/api/v1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be rest.baseUrl.
Are the rest checks working with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I just got lucky that the default was testnet. I tested with this corrected and it works, also tested with a bad endpoint and it failed so I know it's using it now.

cucumberTags: "@acceptance"
enabled: false
image:
pullPolicy: IfNotPresent
repository: gcr.io/mirrornode/hedera-mirror-test
tag: "" # Defaults to the chart's app version

timescaledb:
enabled: false
image:
Expand Down