Browse Source

chore: Fix redis cache plugin tests (#3186)

Michael Bromley 1 year ago
parent
commit
0cd0ef2b8a

+ 7 - 0
.github/workflows/build_and_test.yml

@@ -98,6 +98,12 @@ jobs:
         ports:
           - 9200
         options: --health-cmd="curl --silent --fail localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=3
+      redis:
+        image: bitnami/redis:7.4.1
+        env:
+          ALLOW_EMPTY_PASSWORD: yes
+        ports:
+          - 6379
     strategy:
       fail-fast: false
       matrix:
@@ -121,5 +127,6 @@ jobs:
           E2E_MARIADB_PORT: ${{ job.services.mariadb.ports['3306'] }}
           E2E_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }}
           E2E_ELASTIC_PORT: ${{ job.services.elastic.ports['9200'] }}
+          E2E_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
           DB: ${{ matrix.db }}
         run: npm run e2e

+ 1 - 3
packages/core/e2e/cache-service-redis.e2e-spec.ts

@@ -1,21 +1,19 @@
 import { CacheService, mergeConfig, RedisCachePlugin } from '@vendure/core';
 import { createTestEnvironment } from '@vendure/testing';
 import path from 'path';
-import { afterAll, beforeAll, describe, expect, it } from 'vitest';
+import { afterAll, beforeAll, describe, it } from 'vitest';
 
 import { initialData } from '../../../e2e-common/e2e-initial-data';
 import { TEST_SETUP_TIMEOUT_MS, testConfig } from '../../../e2e-common/test-config';
 
 import {
     deletesAKey,
-    evictsTheOldestKeyWhenCacheIsFull,
     getReturnsUndefinedForNonExistentKey,
     invalidatesALargeNumberOfKeysByTag,
     invalidatesByMultipleTags,
     invalidatesBySingleTag,
     invalidatesManyByMultipleTags,
     setsAKey,
-    setsAKeyWithTtl,
     setsArrayOfObjects,
     setsArrayValue,
     setsObjectValue,