Skip to content

Commit 044023a

Browse files
rtfisherclaude
andcommitted
Add full integration test documentation and update test runner
- Added comprehensive documentation for running full integration tests - Documented time, disk space, and resource requirements - Listed all required components that get built in the Docker image - Provided step-by-step instructions for enabling integration tests - Updated local test runner to match CI behavior (only fail on Hadolint errors, not warnings) - Clarified which tests can be safely enabled after image build 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d2ce672 commit 044023a

2 files changed

Lines changed: 98 additions & 3 deletions

File tree

README_testing.md

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,101 @@ End-to-end workflow tests:
186186
- Significant computational resources
187187
- Platform-specific configurations
188188

189-
To enable these tests, edit `tests/test_integration.bats` and change `skip` to `run` for desired tests.
189+
#### Running Full Integration Tests
190+
191+
**What's Required:**
192+
- **Time**: 15-30+ minutes for initial Docker image build
193+
- **Disk Space**: ~5-10 GB for Docker image and dependencies
194+
- **Network**: Active internet connection for downloading packages
195+
- **Resources**:
196+
- 4+ GB RAM recommended
197+
- Multi-core CPU for faster compilation
198+
- Docker daemon running with sufficient resources allocated
199+
200+
**What Gets Built:**
201+
The full integration tests build a complete Flash-X Docker image including:
202+
- Ubuntu 20.04 base image
203+
- Build tools (gcc, gfortran, make, cmake)
204+
- OpenMPI for parallel computing
205+
- HDF5 libraries for scientific data storage
206+
- Miniconda Python 3.10 environment
207+
- Scientific packages (yt toolkit, h5py)
208+
- FFmpeg for visualization
209+
- Flash-X astrophysical simulation code
210+
- Compiled Sedov test problem
211+
212+
**How to Enable Full Integration Tests:**
213+
214+
1. **Build the Docker image first** (one-time setup):
215+
```bash
216+
# Option 1: Use the run script
217+
./run_flashx.sh
218+
219+
# Option 2: Build directly
220+
docker build -f flashx_dockerfile \
221+
--build-arg USER_ID=$(id -u) \
222+
--build-arg GROUP_ID=$(id -g) \
223+
-t flashx-integration-test .
224+
```
225+
226+
2. **Edit the test file** to enable specific tests:
227+
```bash
228+
# Open the integration test file
229+
vim tests/test_integration.bats
230+
231+
# Find tests with 'skip' and either:
232+
# - Remove the 'skip' line entirely
233+
# - Comment it out with '#'
234+
# - Replace 'skip' with 'run' (in some test frameworks)
235+
```
236+
237+
3. **Run the full integration test suite**:
238+
```bash
239+
bats tests/test_integration.bats
240+
```
241+
242+
**Which Tests to Enable:**
243+
244+
After building the image, you can safely enable these tests:
245+
- "Built image contains Flash-X directory"
246+
- "Container can execute basic commands"
247+
- "Container runs with non-root user"
248+
- "Container has Conda environment activated"
249+
- "Container has yt toolkit installed"
250+
- "Container has h5py installed"
251+
- "Container has OpenMPI installed"
252+
- "Container has gcc installed"
253+
- "Container has gfortran installed"
254+
- "Container has Flash-X repository cloned"
255+
- "Container has Sedov test problem built"
256+
- "Container has MANIFEST file"
257+
- "Container can mount volumes"
258+
- "Container has FFmpeg installed"
259+
- "Container has HDF5 tools"
260+
- "Container has git installed"
261+
- "Container has Python 3.10"
262+
263+
**Time-Intensive Tests** (keep skipped unless needed):
264+
- "Docker image builds successfully" - Full build (~15-30 min)
265+
- "Can execute Flash-X simulation" - Runs actual simulation (~varies)
266+
267+
**Example: Enabling a Single Test**
268+
269+
Before:
270+
```bash
271+
@test "Container has yt toolkit installed" {
272+
skip "Requires built image"
273+
docker run --rm "$TEST_IMAGE" python -c "import yt"
274+
}
275+
```
276+
277+
After:
278+
```bash
279+
@test "Container has yt toolkit installed" {
280+
# skip "Requires built image" # Commented out
281+
docker run --rm "$TEST_IMAGE" python -c "import yt"
282+
}
283+
```
190284

191285
## GitHub Actions CI/CD
192286

tests/run_tests.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ fi
7878
# Run hadolint
7979
if [ "$HADOLINT_AVAILABLE" = true ]; then
8080
echo "Running Hadolint on flashx_dockerfile..."
81-
if hadolint "$PROJECT_ROOT/flashx_dockerfile"; then
82-
echo -e "${GREEN}✓ Hadolint passed${NC}"
81+
# Only fail on errors, not warnings (matching CI configuration)
82+
if hadolint --failure-threshold error "$PROJECT_ROOT/flashx_dockerfile"; then
83+
echo -e "${GREEN}✓ Hadolint passed (errors only)${NC}"
8384
else
8485
echo -e "${RED}✗ Hadolint failed${NC}"
8586
exit 1

0 commit comments

Comments
 (0)