Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eleventyignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
./README.md
./_image_sources
./_drafts
./tests
29 changes: 29 additions & 0 deletions .github/workflows/on_call_staging_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Setup Node.js for BDD tests
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies for BDD tests
run: npm ci

- name: Prepare staging context
run: |
# Copy staging files into the _site directory for the docker build
Expand All @@ -42,3 +51,23 @@ jobs:

# Exit with the test result
exit $exit_code

- name: Run BDD Tests
run: |
# Run BDD tests and capture output for summary
set +e # Don't exit on error so we can capture output
echo "## BDD Test Results" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
npm run test:bdd 2>&1 | tee bdd_output.txt
bdd_exit_code=$?
cat bdd_output.txt >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY

if [ $bdd_exit_code -eq 0 ]; then
echo "✅ BDD tests passed" >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ BDD tests failed (this is expected as step definitions are not yet implemented)" >> $GITHUB_STEP_SUMMARY
fi

# Don't fail the workflow for now since tests are expected to fail
exit 0
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ docker compose run shell

**Note:** `node_modules` are managed inside the container. You do not need to run `npm install` on your host.

## Running Tests

This project uses BDD (Behavior-Driven Development) tests with Gherkin syntax powered by Cucumber.js.

### Running Unit Tests

To run the BDD tests locally:
```bash
npm run test:bdd
```

To run tests in Docker:
```bash
docker compose run test
```

The tests are located in `tests/staging/features/` and use Gherkin feature files to describe expected behavior.

## Preparing to contribute

This project uses the following tools for development:
Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,15 @@ services:
timeout: 5s
retries: 5
start_period: 30s

# BDD Testing service
test:
build:
context: .
dockerfile: tests.Dockerfile
volumes:
- ./tests:/app/tests
- ./package.json:/app/package.json
- ./package-lock.json:/app/package-lock.json
profiles:
- manual
Loading