Skip to content

Commit

Permalink
with UnitTest implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-yves-monnet committed Nov 28, 2024
1 parent c83efdc commit 581a902
Show file tree
Hide file tree
Showing 65 changed files with 8,640 additions and 7,337 deletions.
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ What Process-Automator do:
Process-Automator do not

* Execute service task in unit-scenario
* It is not expected to throw a BPMN Message in the flow: Process-Automator piloted a real system.
* It is not expected to catch a BPMN Message in the flow: Process-Automator piloted a real system.

## Requirement

Expand All @@ -70,7 +70,6 @@ A scenario can be executed on a Camunda 7 or a Camunda 8 server. Process-Automat

## Different usages


### Unit test and regression, unit performance test (unit-scenario)

The unit scenario describes one process instance execution. Creation and user tasks are described.
Expand All @@ -94,6 +93,32 @@ Visit [Load Test Scenario](doc/loadtestscenario/README.md) and the [Load test Tu

## Scenario

Process-Execution-Automator execute a scenario.

A scenario define
* a list of robots. A robot
* Create process instances,
* Execute service task,
* Execute user tasks
* some objectives
* How many process instance must be created
* How many service task has to be executed
* Time to execute a section in the process
* a warm up section

Due to the “backoff strategy”, workers need to be wake up

Robots can be registered in the same pod
![C8CrawlUrl.png](doc/scenarioreference/C8CrawlUrl.png)

Or multiple pods can be defined. Each pod run the process-execution-automator on the same scenario, but limit which robots are executed
![C8CrawlUrl-multiple-pods.png](doc/scenarioreference/C8CrawlUrl-multiple-pods.png)


For unit testing, the execution is different. The pod is started, but don't start immediately the scenario.



This section references all the information to build a scenario.
Visit [Scenario reference](doc/scenarioreference/README.md)

Expand Down
570 changes: 570 additions & 0 deletions doc/scenarioreference/C8CrawlUrl.bpmn

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions doc/unittestscenario/SendUnitTestCommand.rest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### POST Request
POST http://localhost:8381/api/unittest/run?name=ScoreAcceptanceScn&server=Camunda8Ruby&wait=false
Content-Type: application/json

{
}


### POST Request
GET http://localhost:8381/api/unittest/get?id=1732767184446
Content-Type: application/json

{
}

### GET LIST
GET http://localhost:8381/api/unittest/list
Content-Type: application/json

{
}
94 changes: 94 additions & 0 deletions doc/unittestscenario/resources/ScoreAcceptanceScn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"name": "ScoreAcceptance",
"processId": "ScoreAcceptance",
"serverType": "Camunda_8",
"typeScenario": "UNIT",
"executions": [
{
"name": "ScoreAccepted",
"steps": [
{
"type": "STARTEVENT",
"taskId": "ScoreApplication",
"processId": "ScoreAcceptance",
"variables": {
"score": 245
}
}
],
"verifications": {
"activities": [
{
"type": "ActGetScore",
"taskId": "ActGetScore"
},
{
"description": "we accepted the application with this amount",
"type": "TASK",
"taskId": "ActSendAcceptation"
},
{
"type": "ENDEVENT",
"taskId": "EndAccepted"
}
],
"variables": [
{
"description": "we accepted the application with this amount",
"name": "accepted",
"value": true
}
],
"performances": [
{
"description": "From get Score to the End Event, less than 200 ms",
"fromFlowNode": "ActGetScore",
"fromMarker": "begin",
"toFlowNode": "EndAccepted",
"toMarker": "end",
"duration": "PT0.2S"
},
{
"description": "GetScore must be performed in less than 100 ms",
"fromFlowNode": "ActGetScore",
"fromMarker": "begin",
"toFlowNode": "ActGetScore",
"toMarker": "end",
"duration": "PT0.1S"
}
]
}
},
{
"name": "ScoreRejected",
"steps": [
{
"type": "STARTEVENT",
"taskId": "ScoreApplication",
"processId": "ScoreAcceptance",
"variables": {
"score": 67
}
}
],
"verifications": {
"activities": [
{
"type": "TASK",
"taskId": "ActSendRejection"
},
{
"type": "ENDEVENT",
"taskId": "EndRejected"
}
],
"variables": [
{
"name": "accepted",
"value": false
}
]
}
}
]
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.camunda.community.automator</groupId>
<artifactId>process-execution-automator</artifactId>

<version>1.7.1</version>
<version>1.8.0</version>
<!-- Change the banner.txt version -->
<!-- 1.5 Change OperateClient / TaskList Library -->
<!-- 1.6 Increase option multithreading-->
Expand Down
Loading

0 comments on commit 581a902

Please sign in to comment.