Skip to content

How to Add Integration Tests for a New Example Family

Anooja Jayaraj edited this page May 23, 2026 · 1 revision

Overview

PAOFLOW already contains three useful integration-test patterns:

  1. QE-style split assets Use this when the test needs two different kinds of external data:

    • runtime input assets, such as saved DFT outputs
    • reference outputs for regression comparison
  2. Transport-style combined assets Use this when one asset bundle can reasonably contain both the runtime inputs and the reference outputs.

  3. TBmodel-style reference-only assets Use this when the example is self-contained and only needs pre-generated output files for comparison.

If you want to add integration tests for a new family such as VASP or ACBN0, the safest approach is to copy one of these patterns rather than inventing a fourth style unless the workload genuinely requires it.


The Main Design Rule

An integration test should answer one question:

Can this example still run successfully and produce numerically consistent results in an isolated environment?

To make that practical in CI, the test suite should:

  1. run only the minimum workflow needed at test time
  2. avoid expensive external calculations during CI
  3. compare generated outputs against known-good reference data
  4. stage large or expensive prerequisites as release assets instead of committing them to the repository

Choose the Right Pattern First

Pattern A: Split assets

Choose this pattern when the example needs both:

  • external runtime inputs that are expensive to regenerate
  • separate reference outputs for regression checking

This is the current QE pattern.

Typical examples:

  • QE-based examples
  • VASP-based examples
  • any workflow where PAOFLOW consumes previously generated DFT artifacts

Use this if your examples depend on files like:

  • saved wavefunction folders
  • XML metadata from an external code
  • heavy binary artifacts
  • precomputed orbital projections or intermediate data

Recommended asset layout

  • one archive for runtime inputs
  • one archive for reference outputs

Why this works well

It separates “what the example needs in order to run” from “what the test compares against,” which makes debugging and asset refreshes much cleaner.


Pattern B: Combined assets

Choose this pattern when the example needs a small set of runtime inputs and reference outputs that naturally belong together.

This is the current transport pattern.

Typical examples:

  • examples that need a few saved input folders plus Reference output folders
  • workflows where bundling everything into one archive is simpler than splitting it

Recommended asset layout

  • one archive containing:
    • runtime input directories
    • Reference output directories

Why this works well

It minimizes moving parts when there is no strong reason to keep input assets and reference outputs separate.


Pattern C: Reference-only assets

Choose this pattern when the example can run from committed source files alone and the only thing you need from assets is the expected output for comparison.

This is the current TBmodel pattern.

Typical examples:

  • self-contained Python-only examples
  • examples that do not need external QE, VASP, or other heavy upstream outputs at test time

Recommended asset layout

  • one archive containing only expected output files

Why this works well

It keeps the harness small and makes the test easy to run locally.


Recommended Directory Layout

For a new example family named vasp, acbn0, or something else, follow this structure.

Test harness

tests/integration/<family>/
  __init__.py
  README.md
  assets.py
  conftest.py
  jobs.py
  runner.py
  compare.py
  test_<family>_examples.py
  example01/
  example02/

Clone this wiki locally