-
Notifications
You must be signed in to change notification settings - Fork 1
Testing.md
The Banking System repository favors lightweight tooling and deterministic smoke tests. This guide outlines available checks and how to run them locally or in CI.
Compile all sources with javac to ensure the codebase is buildable:
mkdir -p build/classes
find src -name '*.java' > sources.txt
javac -d build/classes @sources.txtThe repository includes a suite of JUnit 5-style tests under src/test/java. Because the project avoids a heavyweight build system, the tests compile against lightweight stubs that mimic the org.junit.jupiter.api annotations and assertion APIs. To execute the tests:
- Compile sources and tests onto the same classpath.
- Use a Java test runner of your choice (e.g., an IDE,
java org.junit.platform.console.ConsoleLauncher).
Example using the JUnit Platform Console Launcher (requires downloading the launcher JAR):
java -jar junit-platform-console-standalone.jar \
-cp build/classes:src/test/java \
--scan-classpathA minimal integration check ensures persistence flows work end-to-end:
java -cp build/classes banking.test.PersistenceSmokeTestThe test provisions a temporary storage directory, runs a sample transaction, and verifies the serialized state.
Run migrations with:
BANKING_DATA_PATH="$(pwd)/tmp/data/banking_state.properties" bash deploy/scripts/run-migrations.shWhen BANKING_JDBC_URL is not set, the script logs the omission and exits successfully, keeping CI pipelines green.
GitHub Actions automates the following steps on pull requests:
- Checkout and compile all Java sources.
- Package runnable JARs for the console and API applications.
- Run filesystem-backed migrations and the persistence smoke test.
- Attempt container builds when Docker Hub is reachable (guarded by a registry availability probe).
Inspect .github/workflows/ci.yml for the authoritative pipeline definition.