diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e6b60ec..aa686ac 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Go +name: Integration Test on: push: @@ -30,9 +30,6 @@ jobs: with: go-version: 1.18 - - name: Build - run: go build -v ./... - - name: Test run: sh ./script/integrate_test.sh diff --git a/Makefile b/Makefile index e8571cf..01216d3 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,16 @@ -# Copyright 2020 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -##@ General - -# The help target prints out all targets with their descriptions organized -# beneath their categories. The categories are represented by '##@' and the -# target descriptions by '##'. The awk commands is responsible for reading the -# entire set of makefiles included in this invocation, looking for lines of the -# file as xyz: ## something, and then pretty-format the target and help. Then, -# if there's a line with ##@ something, that gets pretty-printed as a category. -# More info on the usage of ANSI control characters for terminal formatting: -# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters -# More info on the awk command: -# http://linuxcommand.org/lc3_adv_awk.php - +#Copyright 2014 beego Author. All Rights Reserved. +## +#Licensed under the Apache License, Version 2.0 (the "License"); +#you may not use this file except in compliance with the License. +#You may obtain a copy of the License at +## +# http://www.apache.org/licenses/LICENSE-2.0 +## +#Unless required by applicable law or agreed to in writing, software +#distributed under the License is distributed on an "AS IS" BASIS, +#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +#See the License for the specific language governing permissions and +#limitations under the License. .PHONY: ut ut: @go test -race ./... diff --git a/memcache/memcache_e2e_test.go b/memcache/memcache_e2e_test.go index 0ef2fb9..050751e 100644 --- a/memcache/memcache_e2e_test.go +++ b/memcache/memcache_e2e_test.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build e2e + package memcache import ( diff --git a/random_expired_cache.go b/random_expired_cache.go index 2620011..5fabfe2 100644 --- a/random_expired_cache.go +++ b/random_expired_cache.go @@ -24,8 +24,8 @@ import ( // RandomExpireCacheOption implement genreate random time offset expired option type RandomExpireCacheOption func(*RandomExpireCache) -// WithOffsetFunc returns a RandomExpireCacheOption that configures the offset function -func WithOffsetFunc(fn func() time.Duration) RandomExpireCacheOption { +// WithRandomExpireCacheOffsetFunc returns a RandomExpireCacheOption that configures the offset function +func WithRandomExpireCacheOffsetFunc(fn func() time.Duration) RandomExpireCacheOption { return func(cache *RandomExpireCache) { cache.offset = fn } diff --git a/random_expired_cache_test.go b/random_expired_cache_test.go index 227bde6..3931b3c 100644 --- a/random_expired_cache_test.go +++ b/random_expired_cache_test.go @@ -156,10 +156,10 @@ func TestRandomExpireCacheGetMulti(t *testing.T) { testMemoryCacheGetMulti(t, cache) } -func TestWithOffsetFunc(t *testing.T) { +func TestWithRandomExpireCacheOffsetFunc(t *testing.T) { bm := NewMemoryCache(20) magic := -time.Duration(rand.Int()) - cache := NewRandomExpireCache(bm, WithOffsetFunc(func() time.Duration { + cache := NewRandomExpireCache(bm, WithRandomExpireCacheOffsetFunc(func() time.Duration { return magic })) // offset should return the magic value diff --git a/redis/redis_e2e_test.go b/redis/redis_e2e_test.go index 02f1fe7..4b565a1 100644 --- a/redis/redis_e2e_test.go +++ b/redis/redis_e2e_test.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build e2e + package redis import (