Skip to content

Commit

Permalink
feat: Release/v1.16.26 (#4963)
Browse files Browse the repository at this point in the history
* fix: complete repository empty check (#4889)

* fix: complete repository empty check

* fix: extract method for empty check

* feat: Executor tests - JMeter/JMeterd - extended other cases, special cases (#4894)

* executor tests - jmeter-executor-smoke-2.jmx

* executor tests - jmeter - other and special cases extended

* end - empty line

* jmeter executor smoke - suite updated

* jmeter executor tests - special cases

* jmeter executor tests - special cases - testsuite

* executor tests - run script updated

* executor tests - branch name updated before merge

* end - empty line

* fix: pvc name

* feat: refactored logs stream to allow to be passed and initialized la… (#4892)

* feat: refactored logs stream to allow to be passed and initialized later with id

* feat: added logs for test scheduler errors

* fix: renamed repos

* fix: initialize logs stream only if logs v2 enabled

* Update pkg/logs/events/events.go

Co-authored-by: Lilla Vass <[email protected]>

* fix: comments

* fix: added logs

* fix: logs metghod

---------

Co-authored-by: Lilla Vass <[email protected]>

* fix: remove duplicates

* fix: unit tests

* fix: add OUTPUT_DIR env var

* fix: add unit tests

* fix: add more test cases

* fix: one more test case

* fix: slack token must be set to initialize Slack Listener (#4902)

* test cli image

* delete sha output

* feat: add status field to artifacts (#4908)

* feat: add minio log consumer with opts (#4867)

* feat: add minio log consumer with opts

* fix: tests

* fix: skip test

* fix: improve code and error handling

* fix: handle chunk too big

* fix: execute but return errors

* fix: minor improvements

* fix: contexts

* fix: fiber doesn't allow to use query string outside handler

* feat: Executor tests  - container executor - Gradle and Maven (#4898)

* executor tests - container executor - maven and gradle

* empty lines added

* empty lines added

* fix: dep update

* fix: dep update

* fix: add gradle home

* add support for skipping cert verification of presigned put urls (#4915)

* fix: trigger event for logs start (#4916)

* feat: trigger logs startstop events

* fix: single NATS construct func

* fix: use parametrized nats connection when creating encoded one (#4918)

* feat: trigger logs startstop events

* fix: single NATS construct func

* fix: added nats conn with valid opts

* build: bump follow-redirects from 1.15.1 to 1.15.4 in /docs (#4868)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.1 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.1...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: support missing run path

* fix: execution id not passed to events (#4920)

* fix: added cooldown time to not stop events too early (#4921)

* fix: execution id not passed to events

* fix: async stop

* fix: rollback to debug on message

* fix: context aware stop wait time

* fix: tests fixed with stop wait time

* fix: smaller docker file (#4919)

* docs: add CircleCI article (#4885)

* docs: add CircleCI article

* Update docs/docs/articles/circleci.md

Co-authored-by: Julianne Fermi <[email protected]>

* Update docs/docs/articles/circleci.md

Co-authored-by: Julianne Fermi <[email protected]>

* Update docs/docs/articles/circleci.md

Co-authored-by: Julianne Fermi <[email protected]>

* Update docs/docs/articles/circleci.md

Co-authored-by: Julianne Fermi <[email protected]>

* Update docs/docs/articles/circleci.md

Co-authored-by: Julianne Fermi <[email protected]>

* Update docs/docs/articles/circleci.md

Co-authored-by: Julianne Fermi <[email protected]>

* Update docs/docs/articles/circleci.md

Co-authored-by: Julianne Fermi <[email protected]>

* Update docs/docs/articles/circleci.md

Co-authored-by: Julianne Fermi <[email protected]>

* Update docs/docs/articles/circleci.md

Co-authored-by: Julianne Fermi <[email protected]>

---------

Co-authored-by: Julianne Fermi <[email protected]>

* feat: Executor tests jmeterd special cases extended, run script fixed (labels) (#4929)

* jmeterd executor tests - special cases extended

* tests - run script fixed (labels)

* empty lines added

* empty lines added

* Discord-Slack Migration (#4928)

Update docs to contain link to Slack channel.

* update cimfor logs service

* add manifest for logs service

* fix bug in manifest creation for logs services

* feat: executor tests - gradle and maven - tests extended, non-default executor tests fixed (#4930)

* executor tests - gradle and maven - tests extended, non-default executor tests - fixed

* empty lines added

* maven testsuite fixed

* chore: refactor of client.Client into client.StreamGetter (#4933)

* feat: executor tests - JMeterd special cases - incorrect filename (#4935)

* executor tests - jmeter special cases extended - incorrect file name

* empty lines added

* docs: add demo to docs overview (#4938)

* add demo to docs overview

* add demo to docs overview

* chore: refactor of stop function (#4934)

* feat: pass execution config to the logs

* fix: there is no map string any in grpc

* fix: rollback to map string string

* fix: improved logs message

* fix: stop response async

* fix: tests

* fix: added test source to the log output

* fix: refactored stop function with retries and stream and consumer comparison

* fix: refactor of stop function with messages occurence handling

* jmeterd: add sanity checking for test file (#4947)

* fix: use pointer everywhere when passing log chunk (#4943)

* fix: use pointer everywhere when passing log chunk

* chore: refactor method name - no response prefix anymore

* fix: added source to old logs

* fix: cleaning how source is set for logs in proxy

* fix: pass feature flags to the executor

* chore: rename

* fix: passed features to constructors

* fix: streamLogs method in job executor

* build: bump github.com/go-playground/locales from 0.14.0 to 0.14.1 (#4869)

Bumps [github.com/go-playground/locales](https://github.com/go-playground/locales) from 0.14.0 to 0.14.1.
- [Release notes](https://github.com/go-playground/locales/releases)
- [Commits](go-playground/locales@v0.14.0...v0.14.1)

---
updated-dependencies:
- dependency-name: github.com/go-playground/locales
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build: bump github.com/itchyny/gojq from 0.12.9 to 0.12.14 (#4870)

Bumps [github.com/itchyny/gojq](https://github.com/itchyny/gojq) from 0.12.9 to 0.12.14.
- [Release notes](https://github.com/itchyny/gojq/releases)
- [Changelog](https://github.com/itchyny/gojq/blob/main/CHANGELOG.md)
- [Commits](itchyny/gojq@v0.12.9...v0.12.14)

---
updated-dependencies:
- dependency-name: github.com/itchyny/gojq
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build: bump github.com/charmbracelet/glamour (#4871)

Bumps [github.com/charmbracelet/glamour](https://github.com/charmbracelet/glamour) from 0.5.1-0.20220727184942-e70ff2d969da to 0.6.0.
- [Release notes](https://github.com/charmbracelet/glamour/releases)
- [Commits](https://github.com/charmbracelet/glamour/commits/v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/charmbracelet/glamour
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build: bump github.com/prometheus/client_golang from 1.16.0 to 1.18.0 (#4873)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.18.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.16.0...v1.18.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build: bump github.com/emicklei/go-restful/v3 from 3.11.0 to 3.11.2 (#4872)

Bumps [github.com/emicklei/go-restful/v3](https://github.com/emicklei/go-restful) from 3.11.0 to 3.11.2.
- [Release notes](https://github.com/emicklei/go-restful/releases)
- [Changelog](https://github.com/emicklei/go-restful/blob/v3/CHANGES.md)
- [Commits](emicklei/go-restful@v3.11.0...v3.11.2)

---
updated-dependencies:
- dependency-name: github.com/emicklei/go-restful/v3
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: added adapter stop (#4948)

* fix: adapter stop call after consumer stop (#4950)

* feat: add minio adapter for logs (#4942)

* feat: add minio adapter for logs

* fix: add all the minio config files

* fix: tests

* fix: parameters in creating

* fix: add more log info

* fix: rename minio adapter

* docs: update Jenkins article (#4949)

* docs: update Jenkins article

* docs: update sidebar

* chore: add jenkins plugin url

* chore: update jenkins docs env vars

* fix: use test start stop event (#4954)

* fix: use test start stop event

* fix: rename event

* fix: handle test start and stop events already present

* fix: tests

* fix: dummy adapter use structured logging (#4957)

* fix: dummy adapter use structured logging

* fix: golang ci fixes

* test logs sidecar

* test logs release

* release logs service

* add cosign

* remove testing

* fix: duplicate merged args

* fix: remove unused parameter

* Add selected webhooks blog content to webhooks doc. (#4958)

* fix: refactor merge args

* fix: remove custom assertion logic in jmeterd executor (#4966)

* fix: remove custom assertion logic in jmeterd executor

* fix: fix failign jmeterd integration test

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: nicufk <[email protected]>
Co-authored-by: Tomasz Konieczny <[email protected]>
Co-authored-by: Jacek Wysocki <[email protected]>
Co-authored-by: Lilla Vass <[email protected]>
Co-authored-by: ypoplavs <[email protected]>
Co-authored-by: Povilas Versockas <[email protected]>
Co-authored-by: Dejan Zele Pejchev <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Catalin <[email protected]>
Co-authored-by: Julianne Fermi <[email protected]>
Co-authored-by: Ale <[email protected]>
  • Loading branch information
12 people authored Feb 2, 2024
1 parent 55ab304 commit 70d5268
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 91 deletions.
22 changes: 12 additions & 10 deletions contrib/executor/jmeterd/pkg/parser/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import (

func mapCSVResultsToExecutionResults(out []byte, results CSVResults) (result testkube.ExecutionResult) {
result = MakeSuccessExecution(out)
if results.HasError {
result.Status = testkube.ExecutionStatusFailed
result.ErrorMessage = results.LastErrorMessage
}
// TODO: Is it enough to just disable it here?
//if results.HasError {
// result.Status = testkube.ExecutionStatusFailed
// result.ErrorMessage = results.LastErrorMessage
//}

for _, r := range results.Results {
result.Steps = append(
Expand Down Expand Up @@ -43,12 +44,13 @@ func mapXMLResultsToExecutionResults(out []byte, results XMLResults) (result tes

samples := append(results.HTTPSamples, results.Samples...)
for _, r := range samples {
if !r.Success {
result.Status = testkube.ExecutionStatusFailed
if r.AssertionResult != nil {
result.ErrorMessage = r.AssertionResult.FailureMessage
}
}
// TODO: Is it enough to disable it here?
//if !r.Success {
// result.Status = testkube.ExecutionStatusFailed
// if r.AssertionResult != nil {
// result.ErrorMessage = r.AssertionResult.FailureMessage
// }
//}

result.Steps = append(
result.Steps,
Expand Down
27 changes: 10 additions & 17 deletions contrib/executor/jmeterd/pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ func (r *JMeterDRunner) Run(ctx context.Context, execution testkube.Execution) (
jtlPath := filepath.Join(outputDir, "report.jtl")
reportPath := filepath.Join(outputDir, "report")
jmeterLogPath := filepath.Join(outputDir, "jmeter.log")
args := execution.Args
args = removeDuplicatedArgs(args)
args, params := mergeDuplicatedArgs(args)
args := mergeDuplicatedArgs(removeDuplicatedArgs(execution.Args))
hasJunit, hasReport := prepareArgs(args, testPath, jtlPath, reportPath, jmeterLogPath)

if mode == jmeterModeDistributed {
Expand All @@ -156,7 +154,7 @@ func (r *JMeterDRunner) Run(ctx context.Context, execution testkube.Execution) (
args = append(args, fmt.Sprintf("-R %v", slaveMeta.ToIPString()))
}

args = injectAndExpandEnvVars(args, params["-e"])
args = injectAndExpandEnvVars(args, nil)
output.PrintLogf("%s Using arguments: %v", ui.IconWorld, envManager.ObfuscateStringSlice(args))

// TODO: this is a workaround, the check should be ideally performed in the getTestPathAndWorkingDir function
Expand Down Expand Up @@ -293,28 +291,23 @@ func removeDuplicatedArgs(args []string) []string {
return args
}

func mergeDuplicatedArgs(args []string) ([]string, map[string][]string) {
allowed := map[string]string{
"-e": "<envVars>",
func mergeDuplicatedArgs(args []string) []string {
allowed := map[string]int{
"-e": 0,
}

duplicates := make(map[string][]string)
for i := len(args) - 1; i >= 0; i-- {
if arg, ok := allowed[args[i]]; ok {
if i+1 >= len(args) {
if counter, ok := allowed[args[i]]; ok {
allowed[args[i]]++
if counter == 0 {
continue
}

if args[i+1] == arg {
continue
}

duplicates[args[i]] = append(duplicates[args[i]], args[i+1])
args = append(args[:i], args[i+2:]...)
args = append(args[:i], args[i+1:]...)
}
}

return args, duplicates
return args
}

func prepareArgs(args []string, path, jtlPath, reportPath, jmeterLogPath string) (hasJunit, hasReport bool) {
Expand Down
136 changes: 72 additions & 64 deletions contrib/executor/jmeterd/pkg/runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (
"path/filepath"
"testing"

"github.com/kubeshop/testkube/pkg/utils/test"

"github.com/golang/mock/gomock"
"github.com/pkg/errors"

"github.com/kubeshop/testkube/pkg/filesystem"

"github.com/kubeshop/testkube/pkg/utils/test"

"github.com/stretchr/testify/assert"

"github.com/kubeshop/testkube/pkg/api/v1/testkube"
Expand Down Expand Up @@ -202,36 +202,21 @@ func TestMergeDuplicatedArgs(t *testing.T) {
name string
args []string
expectedArgs []string
arg string
params []string
}{
{
name: "Duplicated args",
args: []string{"-e", "<envVars>", "-e", "var", "-l"},
expectedArgs: []string{"-e", "<envVars>", "-l"},
arg: "-e",
params: []string{"var"},
args: []string{"-e", "<envVars>", "-e"},
expectedArgs: []string{"<envVars>", "-e"},
},
{
name: "Multiple duplicated args",
args: []string{"-e", "<envVars>", "-e", "var 1", "-e", "var 2", "-l"},
expectedArgs: []string{"-e", "<envVars>", "-l"},
arg: "-e",
params: []string{"var 2", "var 1"},
args: []string{"<envVars>", "-e", "-e", "-l"},
expectedArgs: []string{"<envVars>", "-e", "-l"},
},
{
name: "Non duplicated args",
args: []string{"-e", "<envVars>", "-l"},
expectedArgs: []string{"-e", "<envVars>", "-l"},
arg: "-e",
params: []string{},
},
{
name: "Wrong arg order",
args: []string{"-e", "<envVars>", "var", "-e"},
expectedArgs: []string{"-e", "<envVars>", "var", "-e"},
arg: "-e",
params: []string{},
},
}

Expand All @@ -240,17 +225,12 @@ func TestMergeDuplicatedArgs(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

args, params := mergeDuplicatedArgs(tt.args)
args := mergeDuplicatedArgs(tt.args)

assert.Equal(t, len(args), len(tt.expectedArgs))
for j, arg := range args {
assert.Equal(t, tt.expectedArgs[j], arg)
}

assert.Equal(t, len(params[tt.arg]), len(tt.params))
for j, arg := range params[tt.arg] {
assert.Equal(t, tt.params[j], arg)
}
})
}
}
Expand Down Expand Up @@ -555,54 +535,41 @@ log.info(&quot;=================================&quot;);</stringProp>
const failureJMX = `<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.5">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Kubeshop site" enabled="true">
<stringProp name="TestPlan.comments">Kubeshop site simple perf test</stringProp>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="PATH" elementType="Argument">
<stringProp name="Argument.name">PATH</stringProp>
<stringProp name="Argument.value">/pricing</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1668426657000</longProp>
<longProp name="ThreadGroup.end_time">1668426657000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
</ThreadGroup>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Request" enabled="true">
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Testkube - HTTP Request" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="PATH" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">$PATH</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">PATH</stringProp>
</elementProp>
</collectionProp>
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">testkube.io</stringProp>
<stringProp name="HTTPSampler.port">80</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.domain">testkube.kubeshop.io</stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">https://testkube.io</stringProp>
<stringProp name="HTTPSampler.path"></stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
Expand All @@ -612,18 +579,59 @@ const failureJMX = `<?xml version="1.0" encoding="UTF-8"?>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="-1081444641">SOME_NONExisting_String</stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message"></stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="51547">418</stringProp>
</collectionProp>
<stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">8</intProp>
<stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResultCollector guiclass="AssertionVisualizer" testclass="ResultCollector" testname="Assertion Results" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<threadCounts>true</threadCounts>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="JSR223 PostProcessor" enabled="true">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
<stringProp name="script">println &quot;\nJMeter negative test - failing Thread Group in purpose with System.exit(1)\n&quot;;
System.exit(1);</stringProp>
</JSR223PostProcessor>
<hashTree/>
</hashTree>
</hashTree>
</hashTree>
Expand Down
19 changes: 19 additions & 0 deletions docs/docs/articles/webhooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ import TabItem from "@theme/TabItem";

Webhooks allow you to integrate Testkube with external systems by sending HTTP POST payloads containing information about Testkube executions and their current state when specific events occur. To set up webhooks in Testkube, you'll need to have an HTTPS endpoint to receive the events and a payload template to be sent along with the data.

:::note
Please visit our Blog, [Empowering Kubernetes Tests with Webhooks](https://testkube.io/blog/empowering-kubernetes-tests-with-webhooks) for a tutorial on setting up webhooks for Slack and Grafana Dashboard.
:::

## Benefits of using Webhooks in Testkube

Testkube uses webhooks to integrate with external systems, allowing you to effortlessly synchronize your testing workflows with other tools and platforms. These webhooks are designed to carry critical information regarding your tests as HTTP POST payloads. The information can include the execution and real-time status depending on how you configure it.

To leverage webhooks, you need to ensure that the platform that you want to send information to has an HTTPS endpoint to receive the events. Testkube also allows you to customize the payloads.

You can create a webhook from the dashboard, use the CLI, or create it as a custom resource. Before we show how it’s done, let’s understand a few scenarios where Webhooks in Testkube shine:

- Incident Management & Response: Webhooks can be used to create incidents and alert on-call teams when a critical test fails. This ensures a timely response and avoids any potential disruption due to failures and bugs. With Testkube, you can configure incident management tools like PagerDuty and OpsGenie to receive alerts based on critical events for your tests.

- Communication and Collaboration: You can configure Webhooks in Testkube to send alerts to your teams in your communication tool. This will notify your team of any critical event that needs attention and attend to it before the issue escalates. Some of the popular communications tools like Slack and MS Teams can be configured to receive alerts from Testkube.

- Monitoring and Observability: Webhooks can also be used to send alerts and notifications to your monitoring and observability tools like Prometheus and Grafana. This provides visibility into your tests, alerts you, and ensures that timely corrective actions can be taken.


## Creating a Webhook
The webhook can be created using the Dashboard, CLI, or a Custom Resource.

Expand Down

0 comments on commit 70d5268

Please sign in to comment.