forked from OpenAtomFoundation/pika
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration tests differentiate between cached and non-cached (OpenAt…
…omFoundation#2467) Co-authored-by: liuyuecai <[email protected]>
- Loading branch information
Showing
13 changed files
with
40 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
package pika_integration | ||
|
||
import ( | ||
"testing" | ||
|
||
"context" | ||
. "github.com/bsm/ginkgo/v2" | ||
|
||
. "github.com/bsm/gomega" | ||
"github.com/redis/go-redis/v9" | ||
"testing" | ||
) | ||
|
||
func TestPika(t *testing.T) { | ||
var ( | ||
GlobalBefore func(ctx context.Context, client *redis.Client) | ||
) | ||
|
||
func TestPikaWithCache(t *testing.T) { | ||
GlobalBefore = func(ctx context.Context, client *redis.Client) { | ||
Expect(client.SlaveOf(ctx, "NO", "ONE").Err()).NotTo(HaveOccurred()) | ||
Expect(client.FlushAll(ctx).Err()).NotTo(HaveOccurred()) | ||
Expect(client.ConfigSet(ctx, "cache-model", "1").Err()).NotTo(HaveOccurred()) | ||
} | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Pika integration test with cache done") | ||
} | ||
|
||
func TestPikaWithoutCache(t *testing.T) { | ||
GlobalBefore = func(ctx context.Context, client *redis.Client) { | ||
Expect(client.SlaveOf(ctx, "NO", "ONE").Err()).NotTo(HaveOccurred()) | ||
Expect(client.FlushAll(ctx).Err()).NotTo(HaveOccurred()) | ||
Expect(client.ConfigSet(ctx, "cache-model", "0").Err()).NotTo(HaveOccurred()) | ||
} | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Pika integration test") | ||
RunSpecs(t, "Pika integration test without cache done") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters