Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: npm run serve &

- name: Check for broken links
run: npx broken-link-checker -ro --exclude /docs/managers/ --filter-level 3 --host-requests 8 --user-agent Chrome/90 --exclude https://fonts.gstatic.com/ --exclude https://github.com/galasa-dev/extensions/ http://localhost:9000
run: npx broken-link-checker -ro --exclude /docs/managers/ --filter-level 3 --host-requests 8 --user-agent Chrome/90 --exclude https://fonts.gstatic.com/ --exclude https://github.com/galasa-dev/extensions/ --exclude https://*.algolia.net/ http://localhost:9000

- name: Upload raw site
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
run: npm run serve &

- name: Check for broken links
run: npx broken-link-checker -ro --exclude /docs/managers/ --filter-level 3 --host-requests 8 --user-agent Chrome/90 --exclude https://fonts.gstatic.com/ --exclude https://github.com/galasa-dev/extensions/ http://localhost:9000
run: npx broken-link-checker -ro --exclude /docs/managers/ --filter-level 3 --host-requests 8 --user-agent Chrome/90 --exclude https://fonts.gstatic.com/ --exclude https://github.com/galasa-dev/extensions/ --exclude https://*.algolia.net/ http://localhost:9000

- name: Upload raw site
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
Expand Down
2 changes: 2 additions & 0 deletions src/data/nav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
path: /docs/writing-own-tests/binding-tests
- title: Key principles for writing tests
path: /docs/writing-own-tests/key-principles
- title: Controlling code execution after test failure
path: /docs/writing-own-tests/test-result-provider
- title: The Galasa Ecosystem
path: /docs/ecosystem
items:
Expand Down
11 changes: 11 additions & 0 deletions src/markdown-pages/docs/managers.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ Each Manager is tagged with one of the follow readiness indicators:



<details>
<summary><b>IMS TM Managers</b></summary>

Name | Description |
| :-------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **[IMS TM Manager](/docs/managers/ims-tm-manager)**<br> ![alpha](../../images/alpha.svg) | Provides configuration information for pre-existing IMS TM systems. Drives provisioning services from other managers, e.g. z/OS 3270 Manager. |

</details>



<details>
<summary><b>Cloud Managers</b></summary>

Expand Down
39 changes: 39 additions & 0 deletions src/markdown-pages/docs/writing-own-tests/test-result-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
path: "/docs/writing-own-tests/test-result-provider"
title: "Controlling code execution after test failure"
---

As a tester, you may want the ability to access the result so far of a Galasa test at different points during the test lifecycle, to control the execution of code based on that result.

The `ITestResultProvider` can be used to get the test result so far after the first method invokation in a test. It can give you access to if the test is in Passed or Failed state. You can then check the result so far in your test code and choose to call or not call non-test methods based on this.

The annotation `@TestResultProvider` injects a `ITestResultProvider` object into your test class. The Core Manager updates the provider with the test result so far after each `@BeforeClass`, `@Before`, `@Test`, `@After` and `@AfterClass` method.

To use this capability, simply include the lines of code below in your test:

```java
@TestResultProvider
public ITestResultProvider testResultProvider;
```

In the example below, the `@AfterClass` method retrieves the result from the `ITestResultProvider` and checks if it is Failed. If the result is Failed, the method `myCustomCleanupMethod` is called which could contain some diagnostic collection or clean up of resources, which the tester only wants to be run if the test Failed.

```java
@AfterClass
public void afterClassMethod() throws FrameworkException {
if (testResultProvider.getResult().isFailed()) {
myCustomCleanupMethod();
}
}

private void myCustomCleanupMethod() {
try {
// Some custom cleanup logic that only happens on failures.
} catch(Exception ex) {
logger.error("Failing while cleaning up in myCustomCleanupMethod()");
// Ignore the problem.
}
}
```

There can only be a single instance of the test result provider in each test. This is shared between any Galasa test class variables which are marked with the `@TestResultProvider` annotation. It makes no sense having multiple implementations as they all provide the same result when asked.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Once loaded by the Galasa test runner, there are a few further annotations that

**`@Test`**
<br>
This annotation identifies a method as one that contains test code. Such methods are executed by Galasa by the order in which they appear in the test class - from top to bottom. If a test method fails, the following test methods are bypassed to encourage short, sharp parallel testing. This behaviour can be overridden using the `@StopOnError` annotation on the `class` statement.
This annotation identifies a method as one that contains test code. Such methods are executed by Galasa by the order in which they appear in the test class - from top to bottom. If a test method fails, the following test methods are bypassed to encourage short, sharp parallel testing. This behaviour can be overridden using the `@ContinueOnTestFailure` annotation on the `class` statement.

When a test method succeeds it is marked as PASSED, and if there is an exception it is marked FAILED. Managers can override this marking - for example, if a test throws a specific exception, a Manager could set the result to DISASTER.

Expand Down
Loading