From f4c71f3f0593a8da233678947e210952968849aa Mon Sep 17 00:00:00 2001 From: Quintus van Houdt Date: Sat, 11 May 2024 12:51:41 +0200 Subject: [PATCH] Update documentation, changelog, version and packages. --- CHANGELOG.md | 7 +++++++ DOCUMENT.md | 8 ++++---- FAQ.md | 8 ++++++-- go.mod | 10 +++++----- go.sum | 16 ++++++++-------- plugin-dbg.yaml | 2 +- plugin.yaml | 2 +- sonar-project.properties | 2 +- 8 files changed, 33 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 511a043b8..d38a6960f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +0.5.1 / 2024-05-11 +================== +- Fix parse multidocument testsuites (credits @ivankatliarchuk, resolves #329, resolves #336) +- Improve docker containers (resolves #321) +- Update packages to latest patch versions +- Update documentation (credits @dancer1325) + 0.5.0 / 2024-04-29 ================== - Add feature to support assert 'failedTemplate' to catch a generic error message (credits @ivankatliarchuk, resolves #218) diff --git a/DOCUMENT.md b/DOCUMENT.md index 944f7d2bc..57b9550bd 100644 --- a/DOCUMENT.md +++ b/DOCUMENT.md @@ -223,10 +223,10 @@ Available assertion types are listed below: | `isNotSubset` | **path**: *string*. The `set` path to assert, the value must be an *object*.
**content**: *any*. The content NOT to be contained. | Assert the object as the value of specified **path** that NOT contains the **content**. |
isSubset:
path: spec.template
content:
metadata:
labels:
app: basic
release: MY-RELEASE
| | `lengthEqual` | **path**: *string, optional*. The `set` path to assert the count of array values.
**paths**: *string, optional*. The `set` array of paths to assert the count validation of the founded arrays.
**count**: *int, optional*. The count of the values in the array. | Assert the **count** of the **path** or **paths** to be equal. |
lengthEqual:
path: spec.tls
count: 1
| | `notLengthEqual` | **path**: *string, optional*. The `set` path to assert the count of array values.
**paths**: *string, optional*. The `set` array of paths to assert the count validation of the founded arrays.
**count**: *int, optional*. The count of the values in the array. | Assert the **count** of the **path** or **paths** NOT to be equal. |
notLengthEqual:
path: spec.tls
count: 1
| -| `matchRegex` | **path**: *string*. The `set` path to assert, the value must be a *string*.
**pattern**: *string*. The regex pattern to match (without quoting `/`).
**decodeBase64**: *bool, optional*. Decode the base64 before checking | Assert the value of specified **path** match **pattern**. |
matchRegex:
path: metadata.name
pattern: -my-chart$
| -| `notMatchRegex` | **path**: *string*. The `set` path to assert, the value must be a *string*.
**pattern**: *string*. The regex pattern NOT to match (without quoting `/`).
**decodeBase64**: *bool, optional*. Decode the base64 before checking | Assert the value of specified **path** NOT match **pattern**. |
notMatchRegex:
path: metadata.name
pattern: -my-chat$
| -| `matchRegexRaw` | **pattern**: *string*. The regex pattern to match (without quoting `/`) in a NOTES.txt file. | Assert the value match **pattern**. |
matchRegexRaw:
pattern: -my-notes$
| -| `notMatchRegexRaw` | **pattern**: *string*. The regex pattern NOT to match (without quoting `/`) in a NOTES.txt file. | Assert the value NOT match **pattern**. |
notMatchRegexRaw:
pattern: -my-notes$
| +| `matchRegex` | **path**: *string*. The `set` path to assert, the value must be a *string*.
**pattern**: *string*. The [regex syntax](https://pkg.go.dev/regexp/syntax) pattern to match (without quoting `/`).
**decodeBase64**: *bool, optional*. Decode the base64 before checking | Assert the value of specified **path** match **pattern**. |
matchRegex:
path: metadata.name
pattern: -my-chart$
| +| `notMatchRegex` | **path**: *string*. The `set` path to assert, the value must be a *string*.
**pattern**: *string*. The [regex syntax](https://pkg.go.dev/regexp/syntax) pattern NOT to match (without quoting `/`).
**decodeBase64**: *bool, optional*. Decode the base64 before checking | Assert the value of specified **path** NOT match **pattern**. |
notMatchRegex:
path: metadata.name
pattern: -my-chat$
| +| `matchRegexRaw` | **pattern**: *string*. The [regex syntax](https://pkg.go.dev/regexp/syntax) pattern to match (without quoting `/`) in a NOTES.txt file. | Assert the value match **pattern**. |
matchRegexRaw:
pattern: -my-notes$
| +| `notMatchRegexRaw` | **pattern**: *string*. The [regex syntax](https://pkg.go.dev/regexp/syntax) pattern NOT to match (without quoting `/`) in a NOTES.txt file. | Assert the value NOT match **pattern**. |
notMatchRegexRaw:
pattern: -my-notes$
| | `matchSnapshot` | **path**: *string*. The `set` path for snapshot. | Assert the value of **path** is the same as snapshotted last time. Check [doc](./README.md#snapshot-testing) below. |
matchSnapshot:
path: spec
| | `matchSnapshotRaw` | | Assert the value in the NOTES.txt is the same as snapshotted last time. Check [doc](./README.md#snapshot-testing) below. |
matchSnapshotRaw: {}
| diff --git a/FAQ.md b/FAQ.md index 6edfc64ad..996338197 100644 --- a/FAQ.md +++ b/FAQ.md @@ -2,7 +2,7 @@ ## Installation -Q: **Is is possible to completely remove the plugin installation?**
+Q: **Is it possible to completely remove the plugin installation?**
A: Yes. Using the below command you can uninstall the plugin from usage ``` $ helm plugin uninstall helm-unittest @@ -18,8 +18,12 @@ $ helm helm-unittest ... -d ``` ## DevOps -Q: **How can I setup the helm-unittest plugin in a build environment** +Q: **How can I setup the helm-unittest plugin in a build environment**
A: The helm-unittest plugin has the options _-t, --output-type_ and _-o, --output-file_ which can be use to generate testresults in a file. Most of the Buildservers have a task that can upload the testresult into the server and generate a buildreport, or determine the success or failure of the tests. ``` $ helm helm-unittest ... -t JUnit -o junit-results.xml ``` + +Q: **Can I integrate helm-unittest plugin with the Helm Chart-Testing tool?**
+A: Yes. The Helm Chart-Testing tool as the option to add [additional-commands](https://github.com/helm/chart-testing/blob/main/doc/ct_lint.md#options) when linting is used. This makes it possible to run helm unittest as part of the ct command.
+_Be aware! the required tools like helm and the unittest plugin need to be available on the system_ \ No newline at end of file diff --git a/go.mod b/go.mod index 8cc6aa7c8..b401712c2 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/helm-unittest/helm-unittest go 1.22.0 -toolchain go1.22.2 +toolchain go1.22.3 require ( github.com/bradleyjkemp/cupaloy/v2 v2.8.0 @@ -63,14 +63,14 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect - golang.org/x/crypto v0.22.0 // indirect - golang.org/x/net v0.24.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/oauth2 v0.20.0 // indirect golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.19.0 // indirect + golang.org/x/term v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/protobuf v1.34.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/api v0.30.0 // indirect diff --git a/go.sum b/go.sum index fa233a494..910fc9f5b 100644 --- a/go.sum +++ b/go.sum @@ -196,8 +196,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -212,8 +212,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -246,8 +246,8 @@ golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -277,8 +277,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= -google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/plugin-dbg.yaml b/plugin-dbg.yaml index 8dadac8a4..f711a49c1 100644 --- a/plugin-dbg.yaml +++ b/plugin-dbg.yaml @@ -1,5 +1,5 @@ name: "unittest" -version: "0.5.0" +version: "0.5.1" usage: "unittest for helm charts" description: "Unit test for helm chart in YAML with ease to keep your chart functional and robust." ignoreFlags: false diff --git a/plugin.yaml b/plugin.yaml index 2c6239657..e2e4a7c4b 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: "unittest" -version: "0.5.0" +version: "0.5.1" usage: "unittest for helm charts" description: "Unit test for helm chart in YAML with ease to keep your chart functional and robust." ignoreFlags: false diff --git a/sonar-project.properties b/sonar-project.properties index 319d61141..5c0a7760c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.organization=helm-unittest # This is the name and version displayed in the SonarCloud UI. sonar.projectName=helm-unittest -sonar.projectVersion=0.5.0 +sonar.projectVersion=0.5.1 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. # Define all sources and exclude test-, and vendor files.