File tree Expand file tree Collapse file tree 4 files changed +34
-19
lines changed
packages/adapter-upstash-redis Expand file tree Collapse file tree 4 files changed +34
-19
lines changed Original file line number Diff line number Diff line change 1+ version : " 3"
2+ services :
3+ redis :
4+ image : redis
5+ ports :
6+ - " 6379:6379"
7+ serverless-redis-http :
8+ ports :
9+ - " 8079:80"
10+ image : hiett/serverless-redis-http:latest
11+ environment :
12+ SRH_MODE : env
13+ SRH_TOKEN : uwndz1YIfm9k78mx+mjW8qe7CX33VxRYnscDpZVkt4Y=
14+ SRH_CONNECTION_STRING : " redis://redis:6379"
Original file line number Diff line number Diff line change 3434 "access" : " public"
3535 },
3636 "scripts" : {
37- "test" : " vitest -c ../utils/vitest.config.ts " ,
37+ "test" : " ./test/test.sh " ,
3838 "build" : " tsc"
3939 },
4040 "dependencies" : {
4848 "@upstash/redis" : " ^1.0.1" ,
4949 "dotenv" : " ^10.0.0"
5050 }
51- }
51+ }
Original file line number Diff line number Diff line change @@ -3,24 +3,9 @@ import { runBasicTests } from "utils/adapter"
33import { hydrateDates , UpstashRedisAdapter } from "../src"
44import "dotenv/config"
55
6- if ( ! process . env . UPSTASH_REDIS_URL || ! process . env . UPSTASH_REDIS_KEY ) {
7- test ( "Skipping UpstashRedisAdapter tests, since required environment variables aren't available" , ( ) => {
8- expect ( true ) . toBe ( true )
9- } )
10- process . exit ( 0 )
11- }
12-
13- if ( process . env . CI ) {
14- // TODO: Fix this
15- test ( 'Skipping UpstashRedisAdapter tests in CI because of "Request failed" errors. Should revisit' , ( ) => {
16- expect ( true ) . toBe ( true )
17- } )
18- process . exit ( 0 )
19- }
20-
216const client = new Redis ( {
22- url : process . env . UPSTASH_REDIS_URL ,
23- token : process . env . UPSTASH_REDIS_KEY ,
7+ url : "http://localhost:8079" ,
8+ token : "uwndz1YIfm9k78mx+mjW8qe7CX33VxRYnscDpZVkt4Y=" ,
249} )
2510
2611runBasicTests ( {
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ echo " Initializing container for Upstash-Redis tests (Serverless-Redis-HTTP)"
4+
5+ # Init Redis + serverless-redis-http containers
6+ docker compose up -d
7+
8+ echo " Waiting 10 sec for Redis to start..."
9+ sleep 10
10+
11+ # Always stop container, but exit with 1 when tests are failing
12+ if vitest -c ../utils/vitest.config.ts; then
13+ docker compose down -v
14+ else
15+ docker compose down -v && exit 1
16+ fi
You can’t perform that action at this time.
0 commit comments