mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Basic e2e test
This commit is contained in:
parent
042fa27519
commit
0c56c3d1f9
4 changed files with 265 additions and 0 deletions
32
test/e2e/Dockerfile
Normal file
32
test/e2e/Dockerfile
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
FROM node:18-alpine
|
||||
|
||||
# Install bash and basic utilities (Alpine uses apk, not apt-get)
|
||||
RUN apk add --no-cache bash curl
|
||||
|
||||
# Create a test user to simulate real user environment (Alpine syntax)
|
||||
RUN addgroup -S testuser && adduser -S testuser -G testuser -s /bin/bash
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files first for better caching
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the application
|
||||
COPY . .
|
||||
|
||||
# Switch to test user
|
||||
USER testuser
|
||||
|
||||
# Create home directory structure that bash expects
|
||||
RUN mkdir -p /home/testuser
|
||||
|
||||
# Set environment variables for testing
|
||||
ENV HOME=/home/testuser
|
||||
ENV SHELL=/bin/bash
|
||||
|
||||
# Default command runs our test
|
||||
CMD ["bash", "test/e2e/test-setup.sh"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue