Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 15 additions & 1 deletion .github/workflows/on_call_staging_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,22 @@ jobs:
curl -I -f http://localhost:8080/construction_guide.html || exit_code=1
curl -I -f http://localhost:8080/wiki/lego || exit_code=1

# Run BDD integration tests using docker compose
echo "## BDD Test Results" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
docker compose run test 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

# Stop the service regardless of test outcome
docker compose -f docker-compose.yml -f docker-compose.ci.yml stop staging

# Exit with the test result
# Exit with the test result (don't fail on BDD tests for now)
exit $exit_code
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Orionrobots website source
CC BY SA 3.0 - <http://creativecommons.org/licenses/by-sa/3.0/>
Creative Commons By Attribution Share-Alike v3.0

## Project tooling strategy

This project takes a docker compose first strategy. This is to ensure that the environment things are built in is consistent, and the commands used to build, test and verify in are consistent docker compose variations too.

Some of the tooling is in python, but the majority is in JS with Node. Since the front end is mostly JS, tooling should aim to be written with this.

## Running serve and build in docker


Expand All @@ -22,6 +28,29 @@ 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 Integration Tests

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

Alternatively, you can use Docker Compose (recommended for CI/workflows):
```bash
docker compose run test
```

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