Skip to content

Commit

Permalink
Add CI integ test (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng committed May 19, 2023
1 parent fbc0fdc commit 9554e51
Show file tree
Hide file tree
Showing 105 changed files with 851 additions and 761 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci-integ-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Integration Test
on:
pull_request:
push:
branches:
- 'main'

jobs:
tests:
name: "Integration testing"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Set up iWF environment"
run: docker compose -f integ/docker-compose.yml up -d
- name: "Unit test and Integration test"
run: sleep 30 && make ci-tests #sleep 30s to wait for the server to be ready
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@v2
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
13 changes: 13 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: static check
on: pull_request

jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: golangci-lint by reviewdog
uses: reviewdog/action-golangci-lint@v2
- name: Check code formatting using gofmt
uses: Jerome1337/gofmt-action@v1.0.5
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,13 @@ define remake
@+$(MAKE) --no-print-directory $(addprefix $(BUILD)/,$(1))
endef

# useful to actually re-run to get output again.
# reuse the intermediates for simplicity and consistency.
lint: ## (re)run the linter
$(call remake,proto-lint lint)

# intentionally not re-making, goimports is slow and it's clear when it's unnecessary
fmt: $(BUILD)/fmt ## run goimports

.PHONY: release clean

idl-code-gen: #generate/refresh go clent code for idl, do this after update the idl file
rm -Rf ./gen ; true
openapi-generator generate -i iwf-idl/iwf-sdk.yaml -g go -o gen/iwfidl/ -p packageName=iwfidl -p generateInterfaces=true -p isGoSubmodule=false --git-user-id indeedeng --git-repo-id iwf-idl
rm ./gen/iwfidl/go.* ; rm -rf ./gen/iwfidl/test; true
rm ./gen/iwfidl/go.* ; rm -rf ./gen/iwfidl/test; gofmt -s -w gen; true

clean: ## Clean binaries and build folder
rm -f $(BINS)
Expand Down Expand Up @@ -156,6 +149,12 @@ unitTests:

tests: integTests unitTests

ci-tests:
$Q go test -v -cover ./integ ./iwf -coverprofile coverage.out -coverpkg ./iwf/...

fmt:
$Q gofmt -s -w ./iwf ./iwftest ./integ

help:
@# print help first, so it's visible
@printf "\033[36m%-20s\033[0m %s\n" 'help' 'Prints a help message showing any specially-commented targets'
Expand Down
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# iWF Golang SDK
[![Go Reference](https://pkg.go.dev/badge/github.com/indeedeng/iwf-golang-sdk.svg)](https://pkg.go.dev/github.com/indeedeng/iwf-golang-sdk)
[![Go Report Card](https://goreportcard.com/badge/github.com/indeedeng/iwf-golang-sdk)](https://goreportcard.com/report/github.com/indeedeng/iwf-golang-sdk)
[![Coverage Status](https://codecov.io/github/indeedeng/iwf-golang-sdk/coverage.svg?branch=main)](https://app.codecov.io/gh/indeedeng/iwf-golang-sdk/branch/main)

[![Build status](https://github.com/indeedeng/iwf-golang-sdk/actions/workflows/ci-integ-test.yml/badge.svg?branch=main)](https://github.com/indeedeng/iwf-golang-sdk/actions/workflows/ci-integ-test.yml)



Golang SDK for [iWF workflow engine](https://github.com/indeedeng/iwf)

See [samples](https://github.com/indeedeng/iwf-golang-samples) for how to use this SDK.
Expand All @@ -14,18 +22,16 @@ See [contribution guide](CONTRIBUTION.md)
- [x] Parallel execution of multiple states
- [x] Timer command
- [x] Signal command
- [x] SearchAttributeRW
- [x] DataObjectRW
- [x] StateLocal
- [x] SearchAttribute
- [x] DataAttributes
- [x] StateExecutionLocal
- [x] Signal workflow API
- [x] Get workflow DataObjects/SearchAttributes API
- [x] Get workflow result API
- [x] Search workflow API
- [x] Describe workflow API
- [x] Stop workflow API
- [x] Reset workflow API
- [x] Command type(s) for inter-state communications (e.g. internal channel)
- [X] AnyCommandCompleted Decider trigger type
- [x] More workflow start options: IdReusePolicy, cron schedule, retry
- [x] StateOption: Start/Decide API timeout and retry policy
- [x] Reset workflow by stateId/StateExecutionId
Expand All @@ -43,11 +49,8 @@ See [contribution guide](CONTRIBUTION.md)
- [x] Support failing workflow with results
- [x] Improve workflow uncompleted error return(canceled, failed, timeout, terminated)

## Future
- [ ] Decider trigger type: AnyCommandClosed
- [ ] WaitForMoreResults in StateDecision
- [ ] LongRunningActivityCommand
- [ ] Failing workflow details
- [ ] Auto ContinueAsNew
- [ ] StateOption: more AttributeLoadingPolicy
- [ ] StateOption: more CommandCarryOverPolicy
### 2.0

- [x] Renaming some concepts/APIs with breaking changes(see releaste notes)
- [x] Support workflow RPC
- [x] PARTIAL_WITH_EXCLUSIVE_LOCK persistence loading type
Loading

0 comments on commit 9554e51

Please sign in to comment.