Skip to content

feat: add integration tests#11

Closed
ifropc wants to merge 4 commits into
mainfrom
int-tests
Closed

feat: add integration tests#11
ifropc wants to merge 4 commits into
mainfrom
int-tests

Conversation

@ifropc

@ifropc ifropc commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

🤖 AI summary

Key Changes:

  • Application Refactoring:
    • Modularized fly-app/src/main.rs by extracting route configuration into a setup_routes function, enabling the application to be initialized in both the production server and the test
      environment.
    • Added fly-app/src/test.rs which provides utility functions for Actix-web integration tests, including test_get for verifying JSON responses from API endpoints.
  • Testing Infrastructure & CI:
    • Added a GitHub Actions workflow (.github/workflows/rust.yml) to automate the testing pipeline.
    • Included a docker-compose.yml and a large database dump (fly-app/dump.sql) to provide a consistent PostgreSQL environment for tests.
    • Added helper scripts in fly-app/bin/ for creating database dumps and generating test scenarios.
  • Test Data Generation:
    • Introduced a Scenario Generator tool in fly-app/scenarios_generator/ (using Python and Nix/Flakes) that uses scenarios.yaml to define and generate test data/URLs.
  • Database Models:
    • Added fly-app/src/generated.rs, a significant addition (800+ lines) likely containing database schema mappings or auto-generated models used by the updated API logic.

This commit effectively transitions the project from unit testing to full integration testing against a live database.

@chadoh chadoh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willemneal and I researched briefly and Actix gives us a much more idiomatic Rust way of doing code generation using Rust macros, rather than having a separate yaml file which we then parse with python and emit as separate rust files. The yaml→python→rust toolchain feels very over-complicated and brittle to me.

@chadoh

chadoh commented Apr 27, 2026

Copy link
Copy Markdown
Member

@willemneal or I will work on a separate PR with a simpler Actix/Rust-based testing setup. It will probably be sufficiently different that basing it on this one is not worthwhile. Closing. (We can continue to reference this work via the closed PR, if we want to borrow anything from this.)

@chadoh chadoh closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants