Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems running unit tests after installation #12

Open
tomjunk opened this issue Dec 17, 2024 · 2 comments
Open

problems running unit tests after installation #12

tomjunk opened this issue Dec 17, 2024 · 2 comments

Comments

@tomjunk
Copy link
Contributor

tomjunk commented Dec 17, 2024

https://github.com/FNALssi/spack-mpd?tab=readme-ov-file

starting with "prerequisites" and working through "installation" to the unit tests.

Enclosed is a script I wrote to start from scratch -- starting with clearing out my ${HOME}/.spack directory (we had noticed in an earlier tutorials that some tutorial material didn't work with contents in ${HOME}/spack left over from earlier attempts, and I am trying to start from a clean slate each time). I ran the script on dunebuild03.fnal.gov which has its local disk as

/build/scratch/containers/${USER}

I also enclose the output, capturing both stdout and stderr. I noticed MPD was complaining about a missing MPD configuration, where the message says to e-mail this list.

I also tried it with

spack mpd init

befor the unit tests. The init command said the MPD configuration directory is /build/scratch/containers/trj/st/spack/var/mpd. It contains a config file that has zero length, and I still
get the MPD missing configuration error.

Suggestions? I concatenated the script and its output to a text file for attachment.
mpdt2.txt

@knoepfel
Copy link
Collaborator

@tomjunk, thank you for the report. @greenc-FNAL stumbled across a very similar issue yesterday. I made some changes to MPD. Can you pull those changes and try again? Please let me know what you find out.

@tomjunk
Copy link
Contributor Author

tomjunk commented Dec 21, 2024

Thanks! This is an improvement. I reran my script but still see a couple of unit test failures:

==> MPD initialized for Spack instance at /build/scratch/containers/trj/st/spack
==> MPD configuration directory: /build/scratch/containers/trj/st/spack/var/mpd
==> Warning: The default behavior of tarfile extraction has been changed to disallow common exploits (including CVE-2007-4559). By default, absolute/parent paths are disallowed and some mode bits are cleared. See https://access.redhat.com/articles/7004769 for more details.
==> Fetching https://ghcr.io/v2/spack/bootstrap-buildcache-v1/blobs/sha256:82ec278bef26c42303a2c2c888612c0d37babef615bc9a0003530e0b8b4d3d2c
==> Fetching https://ghcr.io/v2/spack/bootstrap-buildcache-v1/blobs/sha256:0c5831932608e7b4084fc6ce60e2b67b77dab76e5515303a049d4d30cd772321
==> Installing "clingo-bootstrap@=spack%gcc@=10.2.1~docs+ipo+optimized+python+static_libstdcpp build_system=cmake build_type=Release generator=make patches=bebb819,ec99431 arch=linux-centos7-x86_64" from a buildcache
==> [BOOTSTRAPPING] Spack has missing dependencies, creating a bootstrapping environment
==> [BOOTSTRAPPING] Installing dependencies (py-isort@5, [email protected]:, py-black@:24.1.0, [email protected]:, [email protected]:)
============================= test session starts ==============================
platform linux -- Python 3.9.21, pytest-8.2.1, pluggy-1.5.0
rootdir: /build/scratch/containers/trj/st/spack-mpd
configfile: pytest.ini
testpaths: tests
collected 7 items

tests/test_mpd_clone.py . [ 14%]
tests/test_mpd_init.py . [ 28%]
tests/test_mpd_new_project.py F...F [100%]

=================================== FAILURES ===================================
______________________ test_new_project_all_default_paths ______________________

with_mpd_init = None
tmp_path = PosixPath('/tmp/pytest-of-trj/pytest-11/test_new_project_all_default_p0')

def test_new_project_all_default_paths(with_mpd_init, tmp_path):
    # Specify neither -T or -S
    cwd_a = tmp_path / "a"
    mpd("ls")
    with new_project(name="a", cwd=cwd_a) as out:
        print(out)
        assert f"build area: {cwd_a}/build" in out
        assert f"local area: {cwd_a}/local" in out
        assert f"sources area: {cwd_a}/srcs" in out
        assert "a" == config.selected_project()

        out = mpd("status")
      assert "Selected project: a" in out

E AssertionError: assert 'Selected project: a' in '==> Selected project: a\n Development status: not concretized\n Last installed: ---\n'

tests/test_mpd_new_project.py:54: AssertionError
---------------------------- Captured stdout setup -----------------------------
==> MPD initialized for Spack instance at /build/scratch/containers/trj/st/spack
==> MPD configuration directory: /tmp/pytest-of-trj/pytest-11/mpd2
----------------------------- Captured stdout call -----------------------------
==> No existing MPD projects

==> Warning: No compiler spec specified in the variants list (using environment default)
==> Creating project: a

Using build area: /tmp/pytest-of-trj/pytest-11/test_new_project_all_default_p0/a/build
Using local area: /tmp/pytest-of-trj/pytest-11/test_new_project_all_default_p0/a/local
Using sources area: /tmp/pytest-of-trj/pytest-11/test_new_project_all_default_p0/a/srcs

==> You can clone repositories for development by invoking

spack mpd git-clone --suite

(or type 'spack mpd git-clone --help' for more options)

==> Warning: No compiler spec specified in the variants list (using environment default)
==> Creating project: a

Using build area: /tmp/pytest-of-trj/pytest-11/test_new_project_all_default_p0/a/build
Using local area: /tmp/pytest-of-trj/pytest-11/test_new_project_all_default_p0/a/local
Using sources area: /tmp/pytest-of-trj/pytest-11/test_new_project_all_default_p0/a/srcs

==> You can clone repositories for development by invoking

spack mpd git-clone --suite

(or type 'spack mpd git-clone --help' for more options)

==> Selected project: a
Development status: not concretized
Last installed: ---
_______________________________ test_mpd_refresh _______________________________

with_mpd_init = None
tmp_path = PosixPath('/tmp/pytest-of-trj/pytest-11/test_mpd_refresh0')

def test_mpd_refresh(with_mpd_init, tmp_path):
    with new_project(name="e", cwd=tmp_path):
        cfg = config.selected_project_config()
        out = mpd("refresh")
        new_cfg = config.selected_project_config()
        assert "Project e is up-to-date" in out
      assert cfg == new_cfg

E AssertionError: assert ordereddict([...s', 'ready')]) == ordereddict([...dereddict())])
E
E Omitting 11 identical items, use -vv to show
E Left contains 1 more item:
E {'status': 'ready'}
E Use -v to get more diff

tests/test_mpd_new_project.py:95: AssertionError
---------------------------- Captured stdout setup -----------------------------
==> Warning: MPD already initialized for Spack instance at /build/scratch/containers/trj/st/spack
==> MPD configuration directory: /tmp/pytest-of-trj/pytest-11/mpd2
----------------------------- Captured stdout call -----------------------------

==> Warning: No compiler spec specified in the variants list (using environment default)
==> Creating project: e

Using build area: /tmp/pytest-of-trj/pytest-11/test_mpd_refresh0/build
Using local area: /tmp/pytest-of-trj/pytest-11/test_mpd_refresh0/local
Using sources area: /tmp/pytest-of-trj/pytest-11/test_mpd_refresh0/srcs

==> You can clone repositories for development by invoking

spack mpd git-clone --suite

(or type 'spack mpd git-clone --help' for more options)

==> Project e is up-to-date
============================= slowest 30 durations =============================
1.86s call tests/test_mpd_clone.py::test_new_project_clone
0.80s call tests/test_mpd_new_project.py::test_new_project_only_top_path
0.80s call tests/test_mpd_new_project.py::test_new_project_all_default_paths
0.72s call tests/test_mpd_new_project.py::test_mpd_refresh
0.59s call tests/test_mpd_new_project.py::test_new_project_only_srcs_path
0.57s call tests/test_mpd_new_project.py::test_new_project_no_default_paths
0.25s call tests/test_mpd_init.py::test_mpd_init
0.12s setup tests/test_mpd_clone.py::test_new_project_clone
0.11s setup tests/test_mpd_new_project.py::test_new_project_all_default_paths
0.10s setup tests/test_mpd_new_project.py::test_new_project_only_srcs_path
0.10s setup tests/test_mpd_new_project.py::test_mpd_refresh
0.10s setup tests/test_mpd_new_project.py::test_new_project_only_top_path
0.10s setup tests/test_mpd_new_project.py::test_new_project_no_default_paths

(8 durations < 0.005s hidden. Use -vv to show these durations.)
=========================== short test summary info ============================
FAILED tests/test_mpd_new_project.py::test_new_project_all_default_paths - As...
FAILED tests/test_mpd_new_project.py::test_mpd_refresh - AssertionError: asse...
========================= 2 failed, 5 passed in 6.74s ==========================

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

No branches or pull requests

2 participants