Skip to content
Closed
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
68 changes: 45 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
This module implements support for running [pytest](https://docs.pytest.org/en/latest/contents.html) based tests.

## Usage

MODULE.bazel
```

```bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Why you removed bash?

Copy link
Author

Choose a reason for hiding this comment

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

bazel_dep(name = "itf", version = "0.1")
```

BUILD
```

```python
load("@itf//:defs.bzl", "py_itf_test")

py_itf_test(
Expand All @@ -30,41 +33,60 @@ py_itf_test(

## Development

### Regenerating pip dependencies
### Installing required system dependencies

```bash
sudo apt install clang clang-format
```
$ bazel run //:requirements.update

### Regenerating pip dependencies

```bash
bazel run //:requirements.update
```

### Running test
```
$ bazel test //test/...

```bash
bazel test //test/...
```

Specify additionally:

- ```--test_arg="-s"``` to get stdout/err from pytest
- ```--test_output=all``` to get stdout/err from bazel
- ```--nocache_test_results``` not to cache test runs

### Running test against QNX Qemu
ITF can be run against running Qemu defined here https://github.com/eclipse-score/reference_integration/tree/main/qnx_qemu.

ITF can be run against running Qemu defined in [reference integration repository](https://github.com/eclipse-score/reference_integration/tree/main/qnx_qemu).

Steps:
* Checkout repository https://github.com/eclipse-score/reference_integration
* Run ssh test with qemu started with bridge network
* Start Qemu with bridge network from `reference_integration/qnx_qemu` folder:
```
$ bazel run --config=x86_64-qnx //:run_qemu
```
* Run ITF test from `itf` folder:
```
$ bazel test //test:test_ssh_bridge_network --test_output=streamed
```
* Note: If it fails, check `IP address set to:` in logs of started Qemu and update IP addresses in `itf/config/target_config.json` for `S_CORE_ECU_QEMU_BRIDGE_NETWORK`
* Run ssh test with qemu started with port forwarding
* Start Qemu with bridge network from `reference_integration/qnx_qemu` folder:

- Checkout repository <https://github.com/eclipse-score/reference_integration>
- Run ssh test with qemu started with bridge network
- Start Qemu with bridge network from `reference_integration/qnx_qemu` folder:

```bash
bazel run --config=x86_64-qnx //:run_qemu
```
$ bazel run --config=x86_64-qnx //:run_qemu_portforward

- Run ITF test from `itf` folder:

```bash
bazel test //test:test_ssh_bridge_network --test_output=streamed
```
* Run ITF test from `itf` folder:

- Note: If it fails, check `IP address set to:` in logs of started Qemu and update IP addresses in `itf/config/target_config.json` for `S_CORE_ECU_QEMU_BRIDGE_NETWORK`
- Run ssh test with qemu started with port forwarding
- Start Qemu with bridge network from `reference_integration/qnx_qemu` folder:

```bash
bazel run --config=x86_64-qnx //:run_qemu_portforward
```
$ bazel test //test:test_ssh_port_forwarding --test_output=streamed

- Run ITF test from `itf` folder:

```bash
bazel test //test:test_ssh_port_forwarding --test_output=streamed
```