fix: env.json caching, readiness and unique lockerIDs (#3596)

* fix: readiness check

* disable cache for env.json

* always generate unique lockerID

* fix tests
This commit is contained in:
Livio Amstutz
2022-05-04 17:09:49 +02:00
committed by GitHub
parent 929ed8745a
commit 94e420bb24
11 changed files with 8 additions and 276 deletions

View File

@@ -3,7 +3,6 @@ package projection
import (
"testing"
"github.com/zitadel/zitadel/internal/domain"
"github.com/zitadel/zitadel/internal/errors"
"github.com/zitadel/zitadel/internal/eventstore"
"github.com/zitadel/zitadel/internal/eventstore/handler"
@@ -141,66 +140,6 @@ func TestInstanceProjection_reduces(t *testing.T) {
},
},
},
{
name: "reduceSetupStarted",
args: args{
event: getEvent(testEvent(
repository.EventType(instance.SetupStartedEventType),
instance.AggregateType,
[]byte(`{"Step": 1}`),
), instance.SetupStepMapper),
},
reduce: (&InstanceProjection{}).reduceSetupEvent,
want: wantReduce{
projection: InstanceProjectionTable,
aggregateType: eventstore.AggregateType("instance"),
sequence: 15,
previousSequence: 10,
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPSERT INTO projections.instances (id, change_date, sequence, setup_started) VALUES ($1, $2, $3, $4)",
expectedArgs: []interface{}{
"instance-id",
anyArg{},
uint64(15),
domain.Step1,
},
},
},
},
},
},
{
name: "reduceSetupDone",
args: args{
event: getEvent(testEvent(
repository.EventType(instance.SetupDoneEventType),
instance.AggregateType,
[]byte(`{"Step": 1}`),
), instance.SetupStepMapper),
},
reduce: (&InstanceProjection{}).reduceSetupEvent,
want: wantReduce{
projection: InstanceProjectionTable,
aggregateType: eventstore.AggregateType("instance"),
sequence: 15,
previousSequence: 10,
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPSERT INTO projections.instances (id, change_date, sequence, setup_done) VALUES ($1, $2, $3, $4)",
expectedArgs: []interface{}{
"instance-id",
anyArg{},
uint64(15),
domain.Step1,
},
},
},
},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {