Skip to content

Commit f6ec13e

Browse files
committed
Run tests with dependencies in dev
1 parent 99218f9 commit f6ec13e

File tree

11 files changed

+19
-10
lines changed

11 files changed

+19
-10
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"go.testFlags": ["-race", "-timeout", "20s", "-count", "1", "-short"],
2+
"go.testFlags": ["-race", "-timeout", "20s", "-count", "1"], // , "-short"],
33
"peacock.color": "#007fff",
44
"workbench.colorCustomizations": {
55
"sash.hoverBorder": "#3399ff",

backend/test/backend.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"time"
77

88
"github.com/cschleiden/go-workflows/backend"
9+
"github.com/cschleiden/go-workflows/client"
910
"github.com/cschleiden/go-workflows/internal/core"
1011
"github.com/cschleiden/go-workflows/internal/history"
1112
ta "github.com/cschleiden/go-workflows/internal/task"
@@ -181,6 +182,14 @@ func BackendTest(t *testing.T, setup func() backend.Backend, teardown func(b bac
181182
require.Equal(t, activityCompletedEvent.Type, task.NewEvents[0].Type, "Expected new events to be returned")
182183
},
183184
},
185+
{
186+
name: "SignalWorkflow_ErrorWhenInstanceDoesNotExist",
187+
f: func(t *testing.T, ctx context.Context, b backend.Backend) {
188+
c := client.New(b)
189+
err := c.SignalWorkflow(ctx, "does-not-exist", "signal", "value")
190+
require.Error(t, err)
191+
},
192+
},
184193
}
185194

186195
for _, tt := range tests {

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
command: --default-authentication-plugin=mysql_native_password
77
restart: always
88
environment:
9-
MYSQL_ROOT_PASSWORD: SqlPassw0rd
9+
MYSQL_ROOT_PASSWORD: root
1010
ports:
1111
- "3306:3306"
1212

samples/activity-registration/activity-registration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func main() {
2121
ctx := context.Background()
2222

2323
b := sqlite.NewInMemoryBackend()
24-
// b := mysql.NewMysqlBackend("localhost", 3306, "root", "SqlPassw0rd", "simple")
24+
// b := mysql.NewMysqlBackend("localhost", 3306, "root", "test", "simple")
2525

2626
go RunWorker(ctx, b)
2727

samples/cancellation/cancellation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func main() {
2323

2424
//b := sqlite.NewInMemoryBackend()
2525
//b := sqlite.NewSqliteBackend("cancellation.sqlite")
26-
// b := mysql.NewMysqlBackend("localhost", 3306, "root", "SqlPassw0rd", "cancellation")
26+
// b := mysql.NewMysqlBackend("localhost", 3306, "root", "test", "cancellation")
2727
b, err := redis.NewRedisBackend("localhost:6379", "", "RedisPassw0rd", 0)
2828
if err != nil {
2929
panic(err)

samples/complex-parameters/complex-parameters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func main() {
1919

2020
// b := sqlite.NewSqliteBackend("simple.sqlite")
2121
//b := memory.NewMemoryBackend()
22-
b := mysql.NewMysqlBackend("localhost", 3306, "root", "SqlPassw0rd", "simple")
22+
b := mysql.NewMysqlBackend("localhost", 3306, "root", "test", "simple")
2323

2424
// Run worker
2525
go RunWorker(ctx, b)

samples/scale/starter/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func main() {
2525
ctx := context.Background()
2626

2727
//b := sqlite.NewSqliteBackend("../scale.sqlite")
28-
// b := mysql.NewMysqlBackend("localhost", 3306, "root", "SqlPassw0rd", "scale")
28+
// b := mysql.NewMysqlBackend("localhost", 3306, "root", "test", "scale")
2929
b, err := redis.NewRedisBackend("localhost:6379", "", "RedisPassw0rd", 0)
3030
if err != nil {
3131
panic(err)

samples/scale/worker/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func main() {
1616
ctx, cancel := context.WithCancel(context.Background())
1717

1818
//b := sqlite.NewSqliteBackend("../scale.sqlite?_busy_timeout=10000")
19-
// b := mysql.NewMysqlBackend("localhost", 3306, "root", "SqlPassw0rd", "scale")
19+
// b := mysql.NewMysqlBackend("localhost", 3306, "root", "test", "scale")
2020
b, err := redis.NewRedisBackend("localhost:6379", "", "RedisPassw0rd", 0)
2121
if err != nil {
2222
panic(err)

samples/simple-split-worker/starter/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func main() {
1414
ctx := context.Background()
1515

1616
//b := sqlite.NewSqliteBackend("../simple-split.sqlite")
17-
b := mysql.NewMysqlBackend("localhost", 3306, "root", "SqlPassw0rd", "simple")
17+
b := mysql.NewMysqlBackend("localhost", 3306, "root", "test", "simple")
1818

1919
// Start workflow via client
2020
c := client.New(b)

samples/simple-split-worker/worker/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func main() {
1515
ctx := context.Background()
1616

1717
//b := sqlite.NewSqliteBackend("../simple-split.sqlite")
18-
b := mysql.NewMysqlBackend("localhost", 3306, "root", "SqlPassw0rd", "simple")
18+
b := mysql.NewMysqlBackend("localhost", 3306, "root", "test", "simple")
1919

2020
// Run worker
2121
go RunWorker(ctx, b)

0 commit comments

Comments
 (0)