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

run SB tests from cli #708

Merged
merged 9 commits into from
Nov 9, 2023
Merged

run SB tests from cli #708

merged 9 commits into from
Nov 9, 2023

Conversation

CaroMac
Copy link
Contributor

@CaroMac CaroMac commented Oct 5, 2023

No description provided.

Copy link
Member

@jt-nti jt-nti left a comment

Choose a reason for hiding this comment

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

I wasn't able to get the tests to run :(


The SimBank tests are held in the <a href="https://github.com/galasa-dev/simplatform" target="_blank"> Galasa simplatform repository</a> in GitHub. To start running the tests you need to clone the repository and launch SimBank so that the tests are available on your local machine. To find out how to clone the cli repository and launch the SimBank application, follow the instructions in the `Launching SimBank` section in the [Exploring Galasa SimBank using the CLI]() documentation.

After cloning the repository and launching SimBank, complete the following steps to run the SimBankIVT test that is provided with Galasa. The following example uses SimBank OBR version `0.25.0` and Galasa OBR version `0.29.0`.
Copy link
Member

Choose a reason for hiding this comment

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

What does "OBR" mean?

1. In a new terminal, navigate to your `simplatform` directory and run the following command to install and build your project:

```
mvn install
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't work in the simplatform directory. Does it need to be run in both the galasa-simbank-tests and galasa-simplatform-application sub directories? If so, it might be better to convert simplatform into a multi-module project.

galasactl runs submit local --log - \
--obr mvn:dev.galasa/dev.galasa.simbank.obr/0.25.0/obr \
--obr mvn:dev.galasa/dev.galasa.uber.obr/0.29.0/obr \
--class dev.galasa.simbank.tests/dev.galasa.simbank.tests.SimBankIVT
Copy link
Member

Choose a reason for hiding this comment

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

I couldn't get this to work. I tried a few different directories to see if that helped but no luck. It might be useful to include a reminder to run galasactl local init (really weirdly the command fails to run if the bootstrap.properties file is missing but then tries to create it when it does exist!)

Copy link
Member

Choose a reason for hiding this comment

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

Now works with the "Updating the overrides and credentials property files" information! I did trip over running init again, and it might be useful to include an extract of the console output of a successful run just in case things don't go smoothly, e.g. like the run-locally.sh above.

@jt-nti
Copy link
Member

jt-nti commented Nov 9, 2023

Adding settings to overrides.properties and credentials.properties got the tests running! 🎉

1. Edit a file called `overrides.properties` in your `.galasa` folder so that it contains:

@CaroMac CaroMac requested a review from jt-nti November 9, 2023 14:39
Copy link
Member

@jt-nti jt-nti left a comment

Choose a reason for hiding this comment

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

Very happy I could run some Galasa tests with the updated docs, thank you! A few minor comments but it would be great to get these updates published.

@@ -99,7 +124,7 @@ dss.properties
Setup complete
```
1. Locate your user home directory and confirm it contains a `.galasa` folder. On Windows, the user home directory resembles: `C:\Users\<username>`, on MacOS it will be `/Users/<username>` and on Linux `/home/<username>`. Note that any file or folder beginning with a `.` is a hidden folder, so you might need to change the settings on your operating system to show hidden files.
1. Edit a file called `overrides.properties` in your `.galasa` folder so that it contains:
1. EEdit a file called `overrides.properties` in your `.galasa` folder so that it contains the following configuration properties. Configuration properties held in this file is used by Galasa tests at runtime. You can change the value of the properties that are set in this file to enable you to run tests against different configurations without changing the test code. The following example configuration properties enable the provided Galasa SimBank tests to run on your machine:
Copy link
Member

Choose a reason for hiding this comment

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

"EEdit" typo. Maybe, "Configuration properties held in this file are used by Galasa tests at runtime." instead of is used?

@@ -118,7 +143,7 @@ dss.properties
zosmf.server.SIMBANK.port=2040
zosmf.server.SIMBANK.https=false
```
1. Edit a file called `credentials.properties` in your `.galasa` folder so that it contains:
1. Edit a file called `credentials.properties` in your `.galasa` folder. Credentials that are held in this file are used by Galasa tests, for example to pass credentials to the application being tested. Storing values in this file avoids the need to hard-code credentials inside a test class, enabling the test to run in different environments without changing any test code. The following example properties enable the provided Galasa SimBank tests to run on your machine:
Copy link
Member

Choose a reason for hiding this comment

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

Looks good!

@@ -23,6 +23,31 @@ Depending on how you plan to use Galasa, there are several software prerequisite
| 3270 emulator | Optional. Although you do not need a 3270 emulator to run a Galasa test (even if it tests a 3270 application) you can use one to explore Galasa Simbank, a simulated version of an application that helps you get acquainted with Galasa before connecting to a real mainframe to run your own tests. There are many such emulators available but IBM's Personal Communications (PCOMM) is frequently used, as is IBM's Host on Demand software, which includes support for Windows, Linux and MacOS.|


## Installing Java

Install a Java version 11 JDK or later. We do not currently support Java 17 or later. The following example uses Homebrew to install Java version 11 on a MacOS.
Copy link
Member

Choose a reason for hiding this comment

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

Adding a link to Homebrew could be helpful

@@ -58,7 +83,7 @@ dss.properties
Setup complete
```
1. Locate your user home directory and confirm it contains a `.galasa` folder. On Windows, the user home directory resembles: `C:\Users\<username>`, on MacOS it will be `/Users/<username>` and on Linux `/home/<username>`. Note that any file or folder beginning with a `.` is a hidden folder, so you might need to change the settings on your operating system to show hidden files.
1. Edit a file called `overrides.properties` in your `.galasa` folder so that it contains:
1. Edit a file called `overrides.properties` in your `.galasa` folder so that it contains the following configuration properties. Configuration properties held in this file is used by Galasa tests at runtime. You can change the value of the properties that are set in this file to enable you to run tests against different configurations without changing the test code. The following example configuration properties enable the provided Galasa SimBank tests to run on your machine:
Copy link
Member

Choose a reason for hiding this comment

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

"are used" again?

@@ -46,6 +46,86 @@ On Windows (Powershell)

You can now run the Galasa CLI too from any directory in your file system without having to specify the absolute path.

## Installing Java

Install a Java version 11 JDK or later. We do not currently support Java 17 or later. The following example uses Homebrew to install Java version 11 on a MacOS.
Copy link
Member

Choose a reason for hiding this comment

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

Adding a link to Homebrew could be helpful

brew update
brew install maven
```
2. Add the follwing information to your `~/.m2/settings.xml` file:
Copy link
Member

Choose a reason for hiding this comment

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

"follwing" typo.

Also, is this manual step required? It seems to have been added automatically to my settings file.

In order to run the Galasa SimBanks tests you need to add some configuration information in the `overrides.properties` and `credentials.properties` files that were created when you initialised your Galasa home folder by running the ```galasactl local init``` command. Complete the following steps to edit the files:


1. Edit a file called `overrides.properties` in your `.galasa` folder so that it contains the following configuration properties. Configuration properties held in this file is used by Galasa tests at runtime. You can change the value of the properties that are set in this file to enable you to run tests against different configurations without changing the test code. The following example configuration properties enable the provided Galasa SimBank tests to run on your machine:
Copy link
Member

Choose a reason for hiding this comment

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

"are used"?


The following sections explain how to run the `SimBankIVT` test class by using the CLI. Make sure that you have installed the Galasa CLI tool and Java version 11 JDK, and set the JAVA_HOME environment variable, as described in the _Installing the Galasa CLI_ documentation.

## Updating the overrides and credentials property files
Copy link
Member

Choose a reason for hiding this comment

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

Nice, this was the information I needed to get the tests running!


## Running the SimBank IVT test class by using the CLI

The SimBank tests are held in the <a href="https://github.com/galasa-dev/simplatform" target="_blank"> Galasa simplatform repository</a> in GitHub. To start running the tests you need to clone the repository, if you have not already done so. To find out how to clone the cli repository, follow the instruction in the `Launching SimBank` section in the [Exploring Galasa SimBank using the CLI]() documentation.
Copy link
Member

Choose a reason for hiding this comment

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

Missing link for "Exploring Galasa SimBank using the CLI"

galasactl runs submit local --log - \
--obr mvn:dev.galasa/dev.galasa.simbank.obr/0.25.0/obr \
--obr mvn:dev.galasa/dev.galasa.uber.obr/0.29.0/obr \
--class dev.galasa.simbank.tests/dev.galasa.simbank.tests.SimBankIVT
Copy link
Member

Choose a reason for hiding this comment

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

Now works with the "Updating the overrides and credentials property files" information! I did trip over running init again, and it might be useful to include an extract of the console output of a successful run just in case things don't go smoothly, e.g. like the run-locally.sh above.

@CaroMac CaroMac merged commit 60a32ba into galasa-dev:next Nov 9, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants