Skip to content
Snippets Groups Projects
README.md 2.82 KiB
Newer Older
# eu.xfsc.bdd.core Behaviour-driven development (BDD) framework
Steffen Schulze's avatar
Steffen Schulze committed

Based on python's based BDD lib [Behave].
Steffen Schulze's avatar
Steffen Schulze committed

# Description
Steffen Schulze's avatar
Steffen Schulze committed

This is `eu.xfsc.bdd.core` extendable code source helper to implement a BDD test pipeline.
Steffen Schulze's avatar
Steffen Schulze committed

Check it out the [Minimal-project] for "How To".
To start new implementation, duplicate and modify [Minimal-project] or
any other project linked to this repository as git submodule under [Implementations] directory.

CI Automation (Setup, Run and Reports) is set up with Jenkins.
Here's the pipeline visualization from the [Jenkinsfile](Jenkinsfile) [Minimal-project] pipeline:

![Jenkins-pipeline-visualisation-for-bdd.core.png](docs/Jenkins-pipeline-visualisation-for-bdd.core.png)

Steffen Schulze's avatar
Steffen Schulze committed

# Getting started

## Requirements
Steffen Schulze's avatar
Steffen Schulze committed

* Clone with submodules
Steffen Schulze's avatar
Steffen Schulze committed

  ```bash
  git clone --recurse-submodules git@gitlab.eclipse.org:eclipse/xfsc/dev-ops/testing/bdd-executor.git \
    -b optional-branch-name-if-not-main
  ```
Steffen Schulze's avatar
Steffen Schulze committed

* Docker Engine (Docker Desktop, Podman machine, Rancher ...)
* For macOS or Linux, we provide below instructions on how to set up.
* For Windows, we recommend a dockerized setup or a remote (ssh) Linux dev server.

## Setup

There are two ways to set up the development machine:
Steffen Schulze's avatar
Steffen Schulze committed

- [Native or Bare Metal](deployment/bare_metal/README.md) (recommended)
- [Dockerized](deployment/docker/README.md) (most suitable for Windows machine)
Steffen Schulze's avatar
Steffen Schulze committed

## Use your implementation

See [Minimal-project].
Duplicate, edit, add your features and steps.


Steffen Schulze's avatar
Steffen Schulze committed

Once the above [Setup](#setup) is done, we can run.
Steffen Schulze's avatar
Steffen Schulze committed

### 1. Setup environments [env.sample.sh](env.sample.sh)

NOTE: Optional for framework and recommended for concrete implementation.
Steffen Schulze's avatar
Steffen Schulze committed

   ``` bash
   # Duplicate sample file
   $ cp env.sample.sh env.sh
Steffen Schulze's avatar
Steffen Schulze committed

   # Configure file
   $ vim env.sh
Steffen Schulze's avatar
Steffen Schulze committed

   # Start your IDE with new environments
   $ bash ./env.sh
   ```
Steffen Schulze's avatar
Steffen Schulze committed

### 2. Start any required services by the
Steffen Schulze's avatar
Steffen Schulze committed

Usually those are dockerized services.
Steffen Schulze's avatar
Steffen Schulze committed

> **_HINT:_** Ensure on macOS to start Docker Engine (Desktop Docker, Podman machine or Rancher)
before running the below command.
Steffen Schulze's avatar
Steffen Schulze committed

We recommend adding a make command per requirement.
Steffen Schulze's avatar
Steffen Schulze committed

### 3. Execute BDD features
Steffen Schulze's avatar
Steffen Schulze committed

```bash   
make run_bdd_dev
```
### 4. (OPTIONAL) Generate Runtime coverage report
Steffen Schulze's avatar
Steffen Schulze committed

See `eu.xfsc.bdd.core` implementation for Java coverage in [TCR-helper].
```bash
make coverage-report
```
Open Coverage on macOS
``` bash
# e.g.
open ./jars/coverage_with_jar/index.html
```

Open Coverage on Linux
``` bash
# e.g.
xdg-open ./jars/coverage_with_jar/index.html
```
Steffen Schulze's avatar
Steffen Schulze committed

## License

Apache License Version 2.0 see [LICENSE](LICENSE).

----------------------------------------------------------------------------------

[Minimal-project]: implementations/minimal-project/README.md
[Implementations]: ./implementations/
[TCR-helper]: https://gitlab.eclipse.org/eclipse/xfsc/train/BDD/-/blob/main/submodule/trusted-content-resolver-helper/Makefile?ref_type=heads#L54