-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented HARD_GATE functionality in kendo
- Loading branch information
1 parent
ef916f5
commit b9fc50c
Showing
11 changed files
with
265 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | ||
|
||
name: APITestsHardGate-Failing | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Build with Gradle and run unit tests | ||
uses: gradle/gradle-build-action@e2097ccd7e8ed48671dc068ac4efa86d25745b39 | ||
with: | ||
arguments: build --refresh-dependencies | ||
- name: Run failing API tests as gradle task with SET_HARD_GATE=true | ||
run: | | ||
TEST_TYPE=api TAGS=hardGate TARGET_ENVIRONMENT=prod SET_HARD_GATE=true IS_FAILING_TEST_SUITE=true ./gradlew clean run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | ||
|
||
name: APITestsHardGate-Passing | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Build with Gradle and run unit tests | ||
uses: gradle/gradle-build-action@e2097ccd7e8ed48671dc068ac4efa86d25745b39 | ||
with: | ||
arguments: build --refresh-dependencies | ||
- name: Run passing API tests as gradle task with SET_HARD_GATE=true | ||
run: | | ||
TEST_TYPE=api TAGS=hardGate TARGET_ENVIRONMENT=prod SET_HARD_GATE=true IS_FAILING_TEST_SUITE=false ./gradlew clean run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Back to main [README](./../README.md) | ||
|
||
----- | ||
|
||
# Setting up a Hard Gate with kendo | ||
|
||
kendo now offers the capability to establish a Hard Gate for your test execution results, ensuring precise control over your testing process. | ||
|
||
### **For passing tests, any failure within the executed scenarios results in the build being marked as FAILED.** | ||
|
||
### **For failing tests, any occurrence of a _passing_ scenario(s) automatically flags the build as FAILED.** | ||
|
||
This stringent control mechanism not only upholds the reliability of your testing process but also ensures that identified issues are accurately reflected in the build status, facilitating efficient debugging and resolution. | ||
|
||
By implementing the Hard Gate functionality in kendo, you can enhance the efficiency and effectiveness of your test management, enabling precise control and clear insights into your testing outcomes. | ||
|
||
## Enabling the Hard Gate | ||
|
||
To activate the Hard Gate feature, simply include the following parameter in your test execution command or set it as an environment variable: | ||
|
||
SET_HARD_GATE=true | ||
|
||
Once enabled, the Hard Gate provides distinct functionalities for both passing and failing tests. | ||
|
||
### Handling Passing Tests | ||
|
||
With the Hard Gate enabled, passing tests become the focus of execution. By default, all tests tagged with **@failing** are excluded from execution, ensuring that only non-failing tests, i.e., the ones expected to pass, are run. | ||
|
||
To explicitly disable the execution of failing tests, use the following parameter in your test execution command or set it as an environment variable: | ||
|
||
IS_FAILING_TEST_SUITE=false | ||
|
||
If any scenario marked as passing fails during execution, the build status will be marked as **FAILED**. | ||
|
||
## Dealing with Failing Tests | ||
|
||
In the context of the Hard Gate, failing tests are rigorously managed to ensure comprehensive evaluation. | ||
|
||
### Executing Failing Tests | ||
|
||
To specifically execute failing tests, utilize the following parameter in your test execution command: | ||
|
||
IS_FAILING_TEST_SUITE=true | ||
|
||
With this parameter, only tests tagged with **@failing** will be executed. If all scenarios marked as failing indeed fail during execution, the build will be marked as **PASS**. This provides clarity on whether a previously failing test now passes due to a fix in either the test itself or the underlying product issue. | ||
|
||
----- | ||
|
||
Back to main [README](./../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/com/znsio/kendo/exceptions/HardGateFailedException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.znsio.kendo.exceptions; | ||
|
||
public class HardGateFailedException extends RuntimeException { | ||
public HardGateFailedException(String failureMessage) { | ||
super(failureMessage); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
@eat @demo @prod @tags @hardGate | ||
Feature: tags api test | ||
|
||
@first | ||
Scenario: first api | ||
And print 'first api' | ||
|
||
@second @local @demo2 | ||
Scenario: second api | ||
And print 'second api' | ||
And print 'system property foo in second api:', karate.properties['foo'] | ||
|
||
@second @e2e | ||
Scenario: second e2e api | ||
And print 'second e2e api' | ||
|
||
@second @e2e @wip @failing | ||
Scenario: second e2e api failing wip | ||
And print 'second e2e api wip' | ||
|
||
@second @e2e @failing | ||
Scenario: second e2e api failing | ||
And print 'second e2e api failing' | ||
And match 1 == 2 | ||
|
||
@second @e2e @failing | ||
Scenario: second e2e api failing skip | ||
And print 'second e2e api failing skip' | ||
And match 1 == 2 | ||
And print 'second e2e api failing skip' | ||
|
||
@second @e2e @failing | ||
Scenario Outline: second e2e api failing skip | ||
And print 'second e2e api failing skip' | ||
And match <num1> == <num2> | ||
And print 'second e2e api failing skip' | ||
Examples: | ||
| num1 | num2 | | ||
| 1 | 2 | | ||
| 3 | 4 | | ||
|
||
@second @e2e | ||
Scenario Outline: second e2e api passing skip | ||
And print 'second e2e api passing skip' | ||
And match <num1> == <num2> | ||
And print 'second e2e api passing skip' | ||
Examples: | ||
| num1 | num2 | | ||
| 1 | 1 | | ||
| 2 | 2 | | ||
| 3 | 3 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters