Skip to content

Commit

Permalink
chore: adapt to rebased API
Browse files Browse the repository at this point in the history
Signed-off-by: Jiyong Huang <[email protected]>
  • Loading branch information
ngjaying committed Jul 19, 2024
1 parent 04d2648 commit ce2c849
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 48 deletions.
3 changes: 2 additions & 1 deletion internal/conf/conf_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 EMQ Technologies Co., Ltd.
// Copyright 2023-2024 EMQ Technologies Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -438,6 +438,7 @@ func TestSyslogConf_Validate(t *testing.T) {

func TestLoad(t *testing.T) {
require.NoError(t, os.Setenv("KUIPER__RULE__RESTARTSTRATEGY__ATTEMPTS", "10"))
SetupEnv()
InitConf()
cpath, err := GetConfLoc()
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions internal/io/memory/pubsub/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
const IdProperty = "topic"

type pubConsumers struct {
count int
consumers map[string]chan any // The consumer channel list [sourceId]chan, the value must be message or message list
count int
consumers map[string]chan any // The consumer channel list [sourceId]chan, the value must be message or message list
consumersReplaced map[string]int
}

Expand Down
4 changes: 1 addition & 3 deletions internal/io/memory/pubsub/manager_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021-2023 EMQ Technologies Co., Ltd.
// Copyright 2021-2024 EMQ Technologies Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -150,7 +150,6 @@ func TestCreateBeforeDelete(t *testing.T) {

CloseSourceConsumerChannel("test", "source1")
c3 := CreateSub("test", nil, "source1", 100)
chans = append(chans, c3)
expPub = map[string]*pubConsumers{
"test": {
count: 1,
Expand All @@ -163,7 +162,6 @@ func TestCreateBeforeDelete(t *testing.T) {
assert.Equal(t, expPub, pubTopics)

c4 := CreateSub("test", nil, "source1", 100)
chans = append(chans, c4)
CloseSourceConsumerChannel("test", "source1")

expPub = map[string]*pubConsumers{
Expand Down
3 changes: 2 additions & 1 deletion internal/server/yaml_import_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package server

import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -417,7 +418,7 @@ func importUploads(m *MetaConfiguration) error {
}

func importByManager(want map[string]string, m ConfManager, typ string) error {
result := m.Import(want)
result := m.Import(context.Background(), want)
if len(result) < 1 {
return nil
}
Expand Down
39 changes: 0 additions & 39 deletions internal/service/executors_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions pkg/cast/time_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022-2023 EMQ Technologies Co., Ltd.
// Copyright 2022-2024 EMQ Technologies Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -290,7 +290,7 @@ func TestConvertFormat(t *testing.T) {
require.NoError(t, err)
require.Equal(t, "2006-01-02T15:04:05.00Z-0700", s)

s, err = convertFormat("\\")
_, err = convertFormat("\\")
require.Error(t, err)

s, err = convertFormat("yyyy-MM-dd HH:mm:ssSSSSSSSXX")
Expand Down

0 comments on commit ce2c849

Please sign in to comment.