Skip to content

Commit bc7dfc5

Browse files
committed
chore: cache e2e deps
1 parent 7c5f3ce commit bc7dfc5

16 files changed

Lines changed: 49 additions & 13 deletions

File tree

common/src/main/resources/plugin.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ permissions:
2222
bm.command.bmpin:
2323
description: Generates a login pin
2424
default: op
25-

common/src/test/java/me/confuser/banmanager/webenhancer/common/TestScheduler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ public void runAsyncRepeating(Runnable task, Duration initialDelay, Duration per
3939
task.run();
4040
}
4141
}
42-

e2e/.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Ignore node_modules - dependencies are installed in container
2+
tests/node_modules
3+
4+
# Ignore IDE and editor files
5+
.idea
6+
.vscode
7+
*.swp
8+
*.swo
9+
*~
10+
11+
# Ignore OS files
12+
.DS_Store
13+
Thumbs.db
14+
15+
# Ignore git
16+
.git
17+
.gitignore
18+
19+
# Ignore build artifacts
20+
tests/dist
21+
tests/coverage
22+
23+
# Ignore platform-specific files (not needed for test container build)
24+
platforms

e2e/Dockerfile.tests

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1+
# syntax=docker/dockerfile:1
12
FROM node:22-alpine
23

34
WORKDIR /tests
45

56
# Install dependencies first for better caching
7+
# Use BuildKit cache mount to persist npm cache between builds
68
COPY tests/package*.json ./
7-
RUN npm ci
9+
RUN --mount=type=cache,target=/root/.npm \
10+
npm ci
811

912
# Copy test source files
1013
COPY tests/ ./
1114

15+
# Create cache directory for Jest/ts-jest transformations
16+
# This will be mounted as a cache volume at runtime
17+
RUN mkdir -p /tmp/jest_cache
18+
19+
# Set Jest cache directory via environment variable
20+
ENV JEST_CACHE_DIRECTORY=/tmp/jest_cache
21+
1222
# Run tests
1323
CMD ["npm", "test"]
14-

e2e/platforms/bukkit/configs/banmanager/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,3 @@ uuidFetcher:
149149
key: id
150150

151151
geyserPrefix: '.'
152-

e2e/platforms/bukkit/configs/banmanager/messages.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,3 @@ messages:
364364

365365
update:
366366
notify: 'A new version of BanManager is now available'
367-

e2e/platforms/bukkit/configs/bukkit.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ ticks-per:
2828
axolotl-spawns: 1
2929
ambient-spawns: 1
3030
autosave: 6000
31-

e2e/platforms/bukkit/docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ services:
2323
TYPE: "PAPER"
2424
VERSION: "1.21.1"
2525
ONLINE_MODE: "false"
26+
# Skip re-downloading server JAR just to verify hash (speeds up cached runs)
27+
SKIP_SERVER_JAR_HASH_CHECK: "true"
2628
ENABLE_RCON: "true"
2729
RCON_PASSWORD: "testing"
2830
RCON_PORT: 25575
@@ -74,6 +76,9 @@ services:
7476
DB_NAME: banmanager
7577
DB_USER: banmanager
7678
DB_PASSWORD: banmanager
79+
volumes:
80+
# Cache Jest/ts-jest transformations between runs
81+
- jest-cache:/tmp/jest_cache
7782
networks:
7883
- banmanager
7984

@@ -83,3 +88,4 @@ networks:
8388

8489
volumes:
8590
paper-data:
91+
jest-cache:

e2e/platforms/fabric/docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ services:
2424
VERSION: "${MC_VERSION:-1.21.4}"
2525
FABRIC_LOADER_VERSION: "${FABRIC_LOADER:-0.16.9}"
2626
ONLINE_MODE: "false"
27+
# Skip re-downloading server JAR just to verify hash (speeds up cached runs)
28+
SKIP_SERVER_JAR_HASH_CHECK: "true"
2729
ENABLE_RCON: "true"
2830
RCON_PASSWORD: "testing"
2931
RCON_PORT: 25575
@@ -76,6 +78,9 @@ services:
7678
DB_NAME: banmanager
7779
DB_USER: banmanager
7880
DB_PASSWORD: banmanager
81+
volumes:
82+
# Cache Jest/ts-jest transformations between runs
83+
- jest-cache:/tmp/jest_cache
7984
networks:
8085
- banmanager
8186

@@ -87,3 +92,4 @@ volumes:
8792
fabric-data-1.20.1:
8893
fabric-data-1.21.1:
8994
fabric-data-1.21.4:
95+
jest-cache:

e2e/tests/jest.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ module.exports = {
77
verbose: true,
88
forceExit: true,
99
detectOpenHandles: true,
10+
// Use custom cache directory if set (for Docker volume caching)
11+
cacheDirectory: process.env.JEST_CACHE_DIRECTORY || '/tmp/jest_cache',
1012
};

0 commit comments

Comments
 (0)