summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-09-11 11:57:37 +0300
committerValery Piashchynski <[email protected]>2021-09-11 11:57:37 +0300
commitb9521e41aab0b085f9922c535998b6e6a503d723 (patch)
tree1b8becf283e160daa4a30e10bbfa72ccf5033afb
parent0c4dd160a3eec4d76b9b82799c55eea4c5f50629 (diff)
Update codecov
Signed-off-by: Valery Piashchynski <[email protected]>
-rw-r--r--.vscode/settings.json1
-rw-r--r--codecov.yml12
-rw-r--r--pkg/priority_queue/binary_heap_test.go22
3 files changed, 31 insertions, 4 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 5bd8813b..1ec5af52 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -2,6 +2,7 @@
"cSpell.words": [
"addrs",
"amqp",
+ "amqpjobs",
"boltdb",
"gomemcache",
"goridge",
diff --git a/codecov.yml b/codecov.yml
index af46376a..e61cda06 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -17,14 +17,19 @@ ignore:
- "internal"
- "proto"
- "tests"
+ - "systemd"
+ - "utils/to_ptr.go"
- "plugins/metrics/config_test.go"
- "plugins/websockets/storage/storage_test.go"
- "plugins/websockets/config.go"
- - "pkg/bst/bst_test.go"
+ - "plugins/amqp/amqpjobs/config.go"
+ - "plugins/beanstalk/config.go"
+ - "plugins/redis/config.go"
+ - "plugins/redis/kv/config.go"
- "pkg/doc"
+ - "pkg/bst/bst_test.go"
- "pkg/pool/static_pool_test.go"
- "pkg/pool/supervisor_test.go"
- - "pkg/pubsub"
- "pkg/transport/pipe/pipe_factory_spawn_test.go"
- "pkg/transport/pipe/pipe_factory_test.go"
- "pkg/transport/socket/socket_factory_spawn_test.go"
@@ -35,5 +40,4 @@ ignore:
- "pkg/worker/worker_test.go"
- "pkg/events/pool_events.go"
- "pkg/events/worker_events.go"
- - "systemd"
- - "utils/to_ptr.go"
+ - "pkg/events/jobs_events.go"
diff --git a/pkg/priority_queue/binary_heap_test.go b/pkg/priority_queue/binary_heap_test.go
index fb5b83de..456fc27e 100644
--- a/pkg/priority_queue/binary_heap_test.go
+++ b/pkg/priority_queue/binary_heap_test.go
@@ -61,6 +61,28 @@ func TestBinHeap_Init(t *testing.T) {
require.Equal(t, expected, res)
}
+func TestBinHeap_MaxLen(t *testing.T) {
+ a := []Item{Test(2), Test(23), Test(33), Test(44), Test(1), Test(2), Test(2), Test(2), Test(4), Test(6), Test(99)}
+
+ bh := NewBinHeap(1)
+
+ go func() {
+ expected := []Item{Test(1), Test(2), Test(2), Test(2), Test(2), Test(4), Test(6), Test(23), Test(33), Test(44), Test(99)}
+
+ res := make([]Item, 0, 12)
+
+ for i := 0; i < 11; i++ {
+ item := bh.ExtractMin()
+ res = append(res, item)
+ }
+ require.Equal(t, expected, res)
+ }()
+
+ for i := 0; i < len(a); i++ {
+ bh.Insert(a[i])
+ }
+}
+
func TestNewPriorityQueue(t *testing.T) {
insertsPerSec := uint64(0)
getPerSec := uint64(0)