Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 1 addition & 13 deletions .github/workflows/durabletask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,7 @@ jobs:
- name: Pytest unit tests
working-directory: tests/durabletask
run: |
pytest -m "not e2e and not dts" --verbose
# Sidecar for running e2e tests requires Go SDK
- name: Install Go SDK
uses: actions/setup-go@v5
with:
go-version: 'stable'
# Install and run the durabletask-go sidecar for running e2e tests
- name: Pytest e2e tests
working-directory: tests/durabletask
run: |
go install github.com/microsoft/durabletask-go@main
durabletask-go --port 4001 &
pytest -m "e2e and not dts" --verbose
pytest -m "not dts" --verbose

publish-release:
if: startsWith(github.ref, 'refs/tags/v') # Only run if a matching tag is pushed
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

ADDED

- Added `durabletask.testing` module with `InMemoryOrchestrationBackend` for testing orchestrations without a sidecar process

FIXED:

- Fix unbound variable in entity V1 processing
Expand Down
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
init:
pip3 install -r requirements.txt

test-unit:
pytest -m "not e2e" --verbose

test-e2e:
pytest -m e2e --verbose
test:
pytest --verbose

install:
python3 -m pip install .
Expand All @@ -16,4 +13,4 @@ gen-proto:
python3 -m grpc_tools.protoc --proto_path=. --python_out=. --pyi_out=. --grpc_python_out=. ./durabletask/internal/orchestrator_service.proto
rm durabletask/internal/*.proto

.PHONY: init test-unit test-e2e gen-proto install
.PHONY: init test gen-proto install
21 changes: 3 additions & 18 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,10 @@ make gen-proto

This will download the `orchestrator_service.proto` from the `microsoft/durabletask-protobuf` repo and compile it using `grpcio-tools`. The version of the source proto file that was downloaded can be found in the file `durabletask/internal/PROTO_SOURCE_COMMIT_HASH`.

### Running unit tests
### Running tests

Unit tests can be run using the following command from the project root. Unit tests _don't_ require a sidecar process to be running.
Tests can be run using the following command from the project root.

```sh
make test-unit
```

### Running E2E tests

The E2E (end-to-end) tests require a sidecar process to be running. You can use the Durable Task test sidecar using the following `docker` command:

```sh
go install github.com/microsoft/durabletask-go@main
durabletask-go --port 4001
```

To run the E2E tests, run the following command from the project root:

```sh
make test-e2e
make test
```
8 changes: 6 additions & 2 deletions durabletask/internal/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ def new_orchestrator_completed_event() -> pb.HistoryEvent:


def new_execution_started_event(name: str, instance_id: str, encoded_input: Optional[str] = None,
tags: Optional[dict[str, str]] = None) -> pb.HistoryEvent:
tags: Optional[dict[str, str]] = None,
version: Optional[str] = None) -> pb.HistoryEvent:
return pb.HistoryEvent(
eventId=-1,
timestamp=timestamp_pb2.Timestamp(),
executionStarted=pb.ExecutionStartedEvent(
name=name,
version=get_string_value(version),
input=get_string_value(encoded_input),
orchestrationInstance=pb.OrchestrationInstance(instanceId=instance_id),
tags=tags))
Expand Down Expand Up @@ -85,12 +87,14 @@ def new_sub_orchestration_created_event(
event_id: int,
name: str,
instance_id: str,
encoded_input: Optional[str] = None) -> pb.HistoryEvent:
encoded_input: Optional[str] = None,
version: Optional[str] = None) -> pb.HistoryEvent:
return pb.HistoryEvent(
eventId=event_id,
timestamp=timestamp_pb2.Timestamp(),
subOrchestrationInstanceCreated=pb.SubOrchestrationInstanceCreatedEvent(
name=name,
version=get_string_value(version),
input=get_string_value(encoded_input),
instanceId=instance_id)
)
Expand Down
Loading