From 0cd0ef2b8a23535ee380f1d59009f602c1c97224 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Tue, 5 Nov 2024 22:16:24 +0100 Subject: [PATCH] chore: Fix redis cache plugin tests (#3186) --- .github/workflows/build_and_test.yml | 7 +++++++ packages/core/e2e/cache-service-redis.e2e-spec.ts | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 93cc28e664..c73d580b5e 100644 --- a/.github/workflows/build_and_test.yml +++ b/.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 diff --git a/packages/core/e2e/cache-service-redis.e2e-spec.ts b/packages/core/e2e/cache-service-redis.e2e-spec.ts index d1e5928419..a00551f183 100644 --- a/packages/core/e2e/cache-service-redis.e2e-spec.ts +++ b/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,