Skip to content

Commit c75c431

Browse files
committed
feat(example): Create example/demo module
1 parent 39b40e9 commit c75c431

File tree

167 files changed

+2666
-304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+2666
-304
lines changed

.github/actions/build-chutney/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,3 @@ runs:
5656
path: ${{inputs.cache-artifacts}}
5757
retention-days: 1
5858
overwrite: true
59-

.github/actions/build-dsl/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: 'build all projects'
2-
description: 'build all projects sequentially'
1+
name: 'build dsl'
2+
description: 'build dsl'
33
inputs:
44
goals:
55
default: "clean build :chutney-kotlin-dsl:publishToMavenLocal"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'build example'
2+
description: 'build example'
3+
inputs:
4+
goals:
5+
default: "clean install -V -B"
6+
description: "Maven goals to execute"
7+
cache-artifacts:
8+
default: ""
9+
description: "path of artifacts to be cached"
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Build Example
17+
shell: bash
18+
run: |
19+
cd ./example
20+
echo "Running: ${{inputs.goals}}"
21+
mvn ${{inputs.goals}}
22+
cd ..
23+
24+
- name: Temporarily cache jar artifacts
25+
if: inputs.cache-artifacts != ''
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: plugin-artifacts
29+
path: ${{inputs.cache-artifacts}}
30+
retention-days: 1
31+
overwrite: true

.github/actions/build-plugin/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: 'build all projects'
2-
description: 'build all projects sequentially'
1+
name: 'build plugin'
2+
description: 'build plugin'
33
inputs:
44
goals:
55
default: "clean buildPlugin"

.github/workflows/build-all-template.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ jobs:
141141
goals: ${{steps.dsl-goals.outputs.DSL_GOALS}}
142142
cache-artifacts: ${{ inputs.cache-artifacts }}
143143

144+
- name: Build Example
145+
if: ${{! inputs.release}}
146+
id: build-example
147+
uses: ./.github/actions/build-example
148+
with:
149+
goals: ${{steps.chutney-goals.outputs.CHUTNEY_GOALS}}
150+
cache-artifacts: ${{ inputs.cache-artifacts }}
151+
144152
- name: Resolve plugin gradle goal from inputs
145153
if: ${{! inputs.release}}
146154
id: plugin-goals

.github/workflows/release-docker-template.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,14 @@ jobs:
5959
WEBSITE=artifacts/chutney/ui/dist
6060
CONF=chutney/.docker/ui
6161
62-
62+
- name: Build and push demo docker image
63+
uses: docker/build-push-action@v2
64+
with:
65+
context: ${{ github.workspace }}
66+
file: ${{ github.workspace }}/example/.docker/demo/Dockerfile
67+
tags: |
68+
ghcr.io/chutney-testing/chutney/chutney-demo:latest
69+
ghcr.io/chutney-testing/chutney/chutney-demo:${{ inputs.version }}
70+
push: true
71+
build-args: |
72+
CONF=example/.docker/demo

CONTRIBUTING.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ It is forbidden to use _wildcard imports_ (e.g., `import static org.assertj.core
8585

8686
### Javadoc
8787

88-
* Javadoc comments should be wrapped after 80 characters whenever possible.
88+
* Javadoc's comments should be wrapped after 80 characters whenever possible.
8989
* This first paragraph must be a single, concise sentence that ends with a period (".").
9090
* Place `<p>` on the same line as the first line in a new paragraph and precede `<p>` with a blank line.
9191
* Insert a blank line before at-clauses/tags.
@@ -333,8 +333,9 @@ git switch -c release/<RELEASE_VERSION>
333333
git add CHANGELOG.md (see Update Changelog file section)
334334
Update manually `chutneyVersion` in [idea-plugin/gradle.properties](https://github.com/chutney-testing/chutney/blob/main/idea-plugin/gradle.properties)
335335
Update manually `chutneyVersion` in [kotlin-dsl/gradle.properties](https://github.com/chutney-testing/chutney/blob/main/kotlin-dsl/gradle.properties)
336-
mvn versions:set -DnewVersion=<RELEASE_VERSION> -DgenerateBackupPoms=false
337-
mvn versions:set-scm-tag -DnewTag=<RELEASE_VERSION> -DgenerateBackupPoms=false
336+
mvn versions:set -DnewVersion=<RELEASE_VERSION> -DgenerateBackupPoms=false -f chutney/pom.xml
337+
mvn versions:set-scm-tag -DnewTag=<RELEASE_VERSION> -DgenerateBackupPoms=false -f chutney/pom.xml
338+
mvn versions:set -DnewVersion=<RELEASE_VERSION> -DgenerateBackupPoms=false -f example/pom.xml
338339
git add .
339340
git diff --staged
340341
git commit -m "chore: Release <RELEASE_VERSION>"
@@ -375,8 +376,11 @@ In order to effectively release artifacts :
375376
#### Prepare next development
376377

377378
```shell
378-
mvn versions:set -DnewVersion=<NEXT_DEV_VERSION> -DgenerateBackupPoms=false
379-
mvn versions:set-scm-tag -DnewTag=HEAD -DgenerateBackupPoms=false
379+
Update manually `chutneyVersion` in [idea-plugin/gradle.properties](https://github.com/chutney-testing/chutney/blob/main/idea-plugin/gradle.properties)
380+
Update manually `chutneyVersion` in [kotlin-dsl/gradle.properties](https://github.com/chutney-testing/chutney/blob/main/kotlin-dsl/gradle.properties)
381+
mvn versions:set -DnewVersion=<NEXT_DEV_VERSION> -DgenerateBackupPoms=false -f chutney/pom.xml
382+
mvn versions:set-scm-tag -DnewTag=HEAD -DgenerateBackupPoms=false -f chutney/pom.xml
383+
mvn versions:set -DnewVersion=<NEXT_DEV_VERSION> -DgenerateBackupPoms=false -f example/pom.xml
380384
git diff HEAD
381385
git add . && git commit -m "chore: Prepare next development <NEXT_DEV_VERSION>"
382386
git push origin
@@ -398,8 +402,9 @@ git switch -c release/<RELEASE_VERSION>
398402
git add CHANGELOG.md (see Update Changelog file section)
399403
Update manually `chutneyVersion` in [idea-plugin/gradle.properties](https://github.com/chutney-testing/chutney/blob/main/idea-plugin/gradle.properties)
400404
Update manually `chutneyVersion` in [kotlin-dsl/gradle.properties](https://github.com/chutney-testing/chutney/blob/main/kotlin-dsl/gradle.properties)
401-
mvn versions:set -DnewVersion=<RELEASE_VERSION> -DgenerateBackupPoms=false
402-
mvn versions:set-scm-tag -DnewTag=<RELEASE_VERSION> -DgenerateBackupPoms=false
405+
mvn versions:set -DnewVersion=<RELEASE_VERSION> -DgenerateBackupPoms=false -f chutney/pom.xml
406+
mvn versions:set-scm-tag -DnewTag=<RELEASE_VERSION> -DgenerateBackupPoms=false -f chutney/pom.xml
407+
mvn versions:set -DnewVersion=<RELEASE_VERSION> -DgenerateBackupPoms=false -f example/pom.xml
403408
git add .
404409
git diff --staged
405410
git commit -m "chore: Release <RELEASE_VERSION>"

GETTING_STARTED.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ Everything you need to run the app and start coding.
99

1010
## <a name="use"></a> How to run Chutney server
1111

12-
### Run in local-dev mode
12+
### Run with docker
13+
To launch Chutney, two docker images could be used :
14+
* The [local-dev server](chutney/.docker) directly
15+
* The [demo server](example/.docker) with some example scenarios
16+
17+
### Run in local-dev mode manually
1318
To launch Chutney in _local-dev_ mode, use
1419
* the classpath of [packaging/local-dev](chutney/packaging/local-dev) module
1520
* `com.chutneytesting.ServerBootstrap` as main class
@@ -18,6 +23,7 @@ To launch Chutney in _local-dev_ mode, use
1823

1924
### Prerequisites
2025

26+
* [Java](https://adoptium.net/fr/temurin/releases/?package=jdk&version=17) - version 17
2127
* [Maven](https://maven.apache.org/) - version 3.9.2 or higher - Java dependency management
2228
* [Node](https://nodejs.org/en/) - version 20.10.0 or higher - JavaScript runtime
2329
* [Npm] (https://www.npmjs.com/) - version 6.14.4 or higher - JavaScript package manager
@@ -30,14 +36,14 @@ You can use a Javascript launcher such as [Volta](https://volta.sh/) to take car
3036

3137
## How to build
3238

33-
* Build and install Chutney: `chutney/mvn clean install -DskipTests`
34-
* Build and install kotlin-dsl: `kotlin-dsl/gradlew clean build -x test :chutney-kotlin-dsl:publishToMavenLocal`
35-
* Install local-api-insecure-jar: use install-local-api-unsecure-jar [run configuration](https://github.com/chutney-testing/chutney/blob/main/.idea/runConfigurations/install_local_api_unsecure_jar.xml)
39+
* Build and install Chutney: `mvn clean install -DskipTests -f chutney/pom.xml`
40+
* Build and install kotlin-dsl: `cd kotlin-dsl && gradlew clean build -x test :chutney-kotlin-dsl:publishToMavenLocal`
41+
* Install local-api-insecure-jar: use install-local-api-unsecure-jar [run configuration](https://github.com/chutney-testing/chutney/blob/main/.idea/runConfigurations/install_local_api_unsecure_jar.xml) or manually run maven command with options in this file as arguments.
3642
* Build plugin: `idea-plugin/gradlew clean buildPlugin`
3743

3844
## Modules explanation
3945

40-
* chutney: server with ui to show and execute scenario
46+
* chutney: server with ui to show and execute scenario with local-dev docker image
4147
* engine: Execution engine which sole responsibility is to execute scenarios and provide a report for each execution
4248
* packaging: default packaging used to start Chutney
4349
* server/server-core: Main module that
@@ -53,5 +59,5 @@ You can use a Javascript launcher such as [Volta](https://volta.sh/) to take car
5359
* ui : Front-end of Chutney
5460
* kotlin-dsl: dsl to test as code and synchronise scenario with a server
5561
* idea-plugin: plugin intellij to have interaction with a Chutney server
56-
* docs: documenation as code for [chutney-testing](https://www.chutney-testing.com)
57-
62+
* docs: documentation as code for [chutney-testing](https://www.chutney-testing.com)
63+
* example : Example project demonstrating the use of kotlin DSL with demo docker image

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ You can find all the documentation of [how to write a scenario here](https://www
5858
### Example of a scenario
5959

6060
Here is an example of a scenario written in Kotlin.
61-
* [Scenario source](https://github.com/chutney-testing/chutney/blob/main/kotlin-dsl/example/src/main/kotlin/com/chutneytesting/example/scenario/http_scenario.kt)
62-
* [How to run it locally with test containers](https://github.com/chutney-testing/chutney/blob/main/kotlin-dsl/example/src/test/kotlin/com/chutneytesting/example/http/HttpScenarioTest.kt)
61+
* [Scenario source](https://github.com/chutney-testing/chutney/blob/main/example/src/main/kotlin/com/chutneytesting/example/scenario/http_scenario.kt)
62+
* [How to run it locally with test containers](https://github.com/chutney-testing/chutney/blob/main/example/src/test/kotlin/com/chutneytesting/example/http/HttpScenarioTest.kt)
6363

6464
```kotlin
6565
const val HTTP_TARGET_NAME = "HTTP_TARGET"
@@ -143,7 +143,7 @@ Here is an example of a scenario written in Kotlin.
143143
* In this example the scenario will save the content of FILM to an external server.
144144
* Then it will update it, fetch it and finally verify that the FILM has indeed been updated.
145145
* In this scenario we perform Http Actions, you can find [all available Chutney Actions here](https://www.chutney-testing.com/documentation/actions/)
146-
* You can find some other example with jms, kafka, rabbit or sql [here](https://github.com/chutney-testing/chutney/tree/main/kotlin-dsl/example/src/main/kotlin/com/chutneytesting/example/scenario)
146+
* You can find some other example with jms, kafka, rabbit or sql [here](https://github.com/chutney-testing/chutney/tree/main/example/src/main/kotlin/com/chutneytesting/example/scenario)
147147
-------------
148148

149149
## <a name="documentation"></a> Documentation
@@ -166,9 +166,9 @@ You don't need to be a developer to contribute, nor do much, you can simply:
166166
* [Give us advices or ideas](https://github.com/chutney-testing/chutney/discussions/categories/ideas),
167167
* etc.
168168
169-
To help you start, we invite you to read [Contributing](chutney/CONTRIBUTING.md), which gives you rules and code conventions to respect
169+
To help you start, we invite you to read [Contributing](CONTRIBUTING.md), which gives you rules and code conventions to respect
170170
171-
To contribute to this documentation (README, CONTRIBUTING, etc.), we conforms to the [CommonMark Spec](https://spec.commonmark.org/)
171+
To contribute to this documentation (README, CONTRIBUTING, etc.), we conform to the [CommonMark Spec](https://spec.commonmark.org/)
172172
173173
## <a name="support"></a> Support
174174
@@ -188,4 +188,4 @@ Core contributors :
188188
* [Karim Goubbaa](https://github.com/KarimGl)
189189
* [Loic Ledoyen](https://github.com/ledoyen)
190190
191-
We strive to provide a benevolent environment and support any [contribution](#contrib).
191+
We strive to provide a benevolent environment and support any [contribution](#contrib).
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name" : "EIGHT",
3+
"description" : "",
4+
"tags" : [ ],
5+
"constants" : {
6+
"dsKey" : "8"
7+
},
8+
"datatable" : [ ]
9+
}

0 commit comments

Comments
 (0)