Skip to content

Instantly share code, notes, and snippets.

View Noordsestern's full-sized avatar
😈
Kill your heroes and fight

Markus Noordsestern

😈
Kill your heroes and fight
View GitHub Profile
@Noordsestern
Noordsestern / get_all_active_process_instances.py
Created November 24, 2020 21:04
Uses generic camunda client for fetching all active process instances from Camunda
from generic_camunda_client import Configuration, ApiClient, ApiException, ProcessInstanceApi, ProcessInstanceDto
import generic_camunda_client
def get_all_process_instances(process_definition_key):
"""
Returns a list of process instances that are active for a certain process definition identified by key.
"""
configuration = Configuration(host='http://localhost:8080')
@Noordsestern
Noordsestern / Fetch-check-pass.robot
Last active September 15, 2021 10:16
Example of skipping execution CamundaLibrary version 1
*** Tasks ***
Run Robot Service Task
FOR ${i} IN RANGE 0 ${BATCH_SIZE}
${workload} fetch workload my_task_topic_name
${fetched_process_instance} Get fetch response
Pass execution if not $fetched_process_instance Finshed processing ${i} process instances
do something with workload ${workload}
END
@Noordsestern
Noordsestern / fetch-and-pass.robot
Created September 15, 2021 10:13
Example of skipping execution CamundaLibrary version 2
*** Tasks ***
Run Robot Service Task
FOR ${i} IN RANGE 0 ${BATCH_SIZE}
${workload} fetch and pass my_task_topic_name message=Finshed processing ${i} process instances
do something with workload ${workload}
END
@Noordsestern
Noordsestern / delete_process_instance_history.robot
Last active September 15, 2021 12:25
How to delete historic process instances in Camunda with Robot Framework
*** Settings ***
Library RequestsLibrary
Library json
*** Variables ***
${START_BEFORE} 2021-08-01T00:00:00.000+0200
${CAMUNDA_URL} http://localhost:8080
*** Tasks ***
Get history
@Noordsestern
Noordsestern / WebhookMock.py
Last active December 22, 2021 15:57
Small web service for mocking webhooks. Logs all incoming requests. Useful for testing systems that send out notifications. Make system under test send its notifications to this web service and validate the messages on its GET endpoints.
from fastapi import FastAPI, Response, Request
import json
from json import JSONDecodeError
app = FastAPI()
webhook_call = {}
@app.get('/all')
@Noordsestern
Noordsestern / WebhookMockTests.robot
Last active December 22, 2021 20:01
Robot Test Case for WebhookMock.py
*** Settings ***
Library RequestsLibrary
Library Collections
Library json
Test Setup Prepare test case
*** Test Cases ***
Test webhook with Text
${payload_text} Set Variable Hello World
@Noordsestern
Noordsestern / start_robot_webservice.sh
Last active May 10, 2022 07:58
Install and Launch Robot Framework Webservice
pip3 install robotframework-webservice
python3 -m RobotFrameworkService.main -t .
INFO: Started server process [9276]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:5003 (Press CTRL+C to quit)
@Noordsestern
Noordsestern / example-robotframework-webservice-dockerfile
Created May 9, 2022 20:51
Dockerfile defining webservice that runs a task with browserlibrary
FROM ghcr.io/marketsquare/robotframework-browser/rfbrowser-stable:12.3.0
WORKDIR /robot
COPY . .
USER root
RUN chown -R pwuser:pwuser /robot
USER pwuser