Skip to content

Pytest integrated#3331

Open
tomc271 wants to merge 193 commits into
nextfrom
pytest-integrated
Open

Pytest integrated#3331
tomc271 wants to merge 193 commits into
nextfrom
pytest-integrated

Conversation

@tomc271
Copy link
Copy Markdown
Collaborator

@tomc271 tomc271 commented Mar 17, 2026

No description provided.

Comment thread tests/run_integrated_tests.sh Outdated
Comment thread tests/run_integrated_tests.sh Outdated
Comment thread pyproject.toml
Comment thread CMakeLists.txt Outdated
Comment thread .ci_with_cmake.sh
Comment thread tests/integrated/test-boutpp/slicing/test_slicing.py Outdated
Comment thread tests/integrated/test-boutpp/slicing/test_slicing.py Outdated
Comment thread tests/integrated/test-boutpp/slicing/test_slicing.py Outdated
Comment thread tests/integrated/test-command-args/test_command_args.py Outdated
matching either to a file named `test_foo.py`.
Native configuration is x86_64-pc-linux-gnu

		===  tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.

		===  Summary === to  in CMakeLists.txt
so that the `input` directory is found.
so that the `test` directory is found.
Fails due to missing file `grid.fci.nc`.
Change directory to exe location prior to attempting to run it.
Change directory to exe location prior to attempting to run it.
Change directory to exe location prior to attempting to run it.
@tomc271 tomc271 force-pushed the pytest-integrated branch from 87931a7 to f872de6 Compare May 12, 2026 12:10
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread include/bout/coordinates.hxx Outdated
if (!_cell_area_xlow.has_value()) {
_compute_cell_area_x();
}
return *_cell_area_xlow;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

    return *_cell_area_xlow;
            ^

Comment thread include/bout/coordinates.hxx Outdated
Comment thread include/bout/coordinates.hxx Outdated
Comment thread include/bout/coordinates.hxx Outdated
Comment thread include/bout/coordinates.hxx Outdated
Comment thread src/mesh/coordinates.cxx Outdated
Comment thread src/mesh/coordinates.cxx Outdated
Comment thread src/mesh/coordinates.cxx Outdated

void Coordinates::_compute_cell_area_y() const {
_compute_Jxz_cell_faces();
if (_jxz_centre->isFci()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

  if (_jxz_centre->isFci()) {
      ^

Comment thread src/mesh/coordinates.cxx Outdated
ASSERT2(isUniform(dx, false, "RGN_ALL"));
ASSERT3(isUniform(dz, true, "RGN_ALL"));
ASSERT2(isUniform(dz, false, "RGN_ALL"));
_cell_area_ylow.emplace(*_jxz_ylow * dx * dz);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

    _cell_area_ylow.emplace(*_jxz_ylow * dx * dz);
                             ^

Comment thread src/mesh/coordinates.cxx Outdated
ASSERT3(isUniform(dz, true, "RGN_ALL"));
ASSERT2(isUniform(dz, false, "RGN_ALL"));
_cell_area_ylow.emplace(*_jxz_ylow * dx * dz);
_cell_area_yhigh.emplace(*_jxz_yhigh * dx * dz);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

    _cell_area_yhigh.emplace(*_jxz_yhigh * dx * dz);
                              ^

tomchapman added 27 commits May 13, 2026 13:38
(remove spurious collect() wrapper).
Relying on `boutpp.finalise()` doesn't work as xdist workers are reused between tests,
so this fixture calls the test via subprocess to ensure isolation.
Isolate boutpp initialization via subprocess fixture

* Enable set -e in the test script to ensure CI correctly reports failures.

* Implement a run_isolated fixture to spawn a fresh process for tests using the boutpp C++ singleton.

* Resolve pytest-xdist worker crashes caused by persistent MPI and library state.
Passing sys.argv[1:] to boutpp.init() caused problems when run in an isolated python process.
Return a function that evaluates to True in the parent (to abort test execution) and False in the child (to run the actual test).
Fedora CI workflow fails unless openmpi environment variables are cleared between each test.
Increase size of /dev/shm partition to 1GB.
This is used in `run_integrated_tests.sh` to determine the verbosity level for pytest.
to prevent type-checker warnings.
@tomc271 tomc271 force-pushed the pytest-integrated branch from 303d76c to b6b4e1c Compare May 15, 2026 15:24
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.

4 participants