Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <[email protected]>
  • Loading branch information
JorTurFer committed May 26, 2024
1 parent f1c5ffe commit f39b328
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ all: build
##@ Test
.PHONY: install-test-deps
install-test-deps:
go install github.com/jstemmer/go-junit-report/v2@latest
go install gotest.tools/gotestsum@latest

.PHONY: test
test: manifests generate fmt vet envtest install-test-deps ## Run tests and export the result to junit format.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -v 2>&1 ./... -coverprofile cover.out | go-junit-report -iocopy -set-exit-code -out report.xml
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" gotestsum --format standard-quiet --rerun-fails --junitfile report.xml

.PHONY:
az-login:
Expand Down
18 changes: 9 additions & 9 deletions pkg/scalers/azure_eventhub_scaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,50 +206,50 @@ var parseEventHubMetadataDatasetWithPodIdentity = []parseEventHubMetadataTestDat
var calculateUnprocessedEventsDataset = []calculateUnprocessedEventsTestData{
{
checkpoint: azure.NewCheckpoint(5),
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 10, LastEnqueuedOffset: 2},
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 10},
unprocessedEvents: 5,
},
{
checkpoint: azure.NewCheckpoint(4611686018427387903),
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 4611686018427387905, LastEnqueuedOffset: 1000},
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 4611686018427387905},
unprocessedEvents: 2,
},
{
checkpoint: azure.NewCheckpoint(4611686018427387900),
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 4611686018427387905, LastEnqueuedOffset: 1000},
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 4611686018427387905},
unprocessedEvents: 5,
},
{
checkpoint: azure.NewCheckpoint(4000000000000200000),
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 4000000000000000000, LastEnqueuedOffset: 750},
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 4000000000000000000},
unprocessedEvents: 9223372036854575807,
},
// Empty checkpoint
{
checkpoint: azure.NewCheckpoint(0),
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 1, LastEnqueuedOffset: 1},
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 2},
unprocessedEvents: 2,
},
// Stale PartitionInfo
{
checkpoint: azure.NewCheckpoint(15),
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 10, LastEnqueuedOffset: 2},
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 10},
unprocessedEvents: 0,
},
{
checkpoint: azure.NewCheckpoint(4611686018427387910),
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 4611686018427387905, LastEnqueuedOffset: 900},
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 4611686018427387905},
unprocessedEvents: 0,
},
{
checkpoint: azure.NewCheckpoint(5),
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 9223372036854775797, LastEnqueuedOffset: 10000},
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 9223372036854775797},
unprocessedEvents: 0,
},
// Circular buffer reset
{
checkpoint: azure.NewCheckpoint(9223372036854775797),
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 5, LastEnqueuedOffset: 1},
partitionInfo: azeventhubs.PartitionProperties{LastEnqueuedSequenceNumber: 5},
unprocessedEvents: 15,
},
}
Expand Down

0 comments on commit f39b328

Please sign in to comment.