unit-tests: remove a few FIXMEs

This commit is contained in:
Massimiliano Culpo 2024-11-12 13:03:25 +01:00
parent 67011c8e88
commit f764029b0a
No known key found for this signature in database
GPG Key ID: 3E52BB992233066C
4 changed files with 20 additions and 46 deletions

View File

@ -400,24 +400,6 @@ def test_spec_flags_maintain_order(self, mutable_config, gcc11_with_flags):
s.compiler_flags[x] == ["-O0", "-g"] for x in ("cflags", "cxxflags", "fflags")
)
# FIXME (compiler as nodes): revisit this test
# def test_compiler_flags_differ_identical_compilers(self, mutable_config, clang12_with_flags):
# mutable_config.set("compilers", [clang12_with_flags])
# # Correct arch to use test compiler that has flags
# spec = Spec("pkg-a %clang@12.2.0 platform=test os=fe target=fe")
#
# # Get the compiler that matches the spec (
# compiler = spack.compilers.config.compiler_for_spec("clang@=12.2.0", spec.architecture)
#
# # Configure spack to have two identical compilers with different flags
# default_dict = spack.compilers.config._to_dict(compiler)
# different_dict = copy.deepcopy(default_dict)
# different_dict["compiler"]["flags"] = {"cflags": "-O2"}
#
# with spack.config.override("compilers", [different_dict]):
# spec.concretize()
# assert spec.satisfies("cflags=-O2")
@pytest.mark.parametrize(
"spec_str,expected,not_expected",
[

View File

@ -287,11 +287,9 @@ def test_package_fetcher_fails():
def test_package_test_no_compilers(mock_packages, monkeypatch, capfd):
def compilers(compiler, arch_spec):
return None
monkeypatch.setattr(spack.compilers.config, "compilers_for_spec", compilers)
"""Ensures that a test which needs the compiler, and build dependencies, to run, is skipped
if no compiler is available.
"""
s = spack.spec.Spec("pkg-a")
pkg = BaseTestPackage(s)
pkg.test_requires_compiler = True

View File

@ -20,14 +20,11 @@
"""
import io
import pytest
import spack.repo
from spack.provider_index import ProviderIndex
from spack.spec import Spec
@pytest.mark.xfail(reason="FIXME (compiler as nodes): revisit this test")
def test_provider_index_round_trip(mock_packages):
p = ProviderIndex(specs=spack.repo.all_package_names(), repository=spack.repo.PATH)

View File

@ -858,21 +858,18 @@ def test_spec_formatting(self, default_mock_concretization):
package_segments = [
("{NAME}", "", "name", lambda spec: spec),
("{VERSION}", "", "version", lambda spec: spec),
# FIXME (compiler as nodes): recover this semantic
# ("{compiler}", "", "compiler", lambda spec: spec),
("{compiler}", "", "compiler", lambda spec: spec),
("{compiler_flags}", "", "compiler_flags", lambda spec: spec),
("{variants}", "", "variants", lambda spec: spec),
("{architecture}", "", "architecture", lambda spec: spec),
("{@VERSIONS}", "@", "versions", lambda spec: spec),
# FIXME (compiler as nodes): recover this semantic
# ("{%compiler}", "%", "compiler", lambda spec: spec),
("{%compiler}", "%", "compiler", lambda spec: spec),
("{arch=architecture}", "arch=", "architecture", lambda spec: spec),
("{namespace=namespace}", "namespace=", "namespace", lambda spec: spec),
# FIXME (compiler as nodes): recover this semantic
# ("{compiler.name}", "", "name", lambda spec: spec.compiler),
# ("{compiler.version}", "", "version", lambda spec: spec.compiler),
# ("{%compiler.name}", "%", "name", lambda spec: spec.compiler),
# ("{@compiler.version}", "@", "version", lambda spec: spec.compiler),
("{compiler.name}", "", "name", lambda spec: spec.compiler),
("{compiler.version}", "", "version", lambda spec: spec.compiler),
("{%compiler.name}", "%", "name", lambda spec: spec.compiler),
("{@compiler.version}", "@", "version", lambda spec: spec.compiler),
("{architecture.platform}", "", "platform", lambda spec: spec.architecture),
("{architecture.os}", "", "os", lambda spec: spec.architecture),
("{architecture.target}", "", "target", lambda spec: spec.architecture),
@ -1512,17 +1509,17 @@ def test_unsatisfiable_virtual_deps_bindings(self, spec_str):
("git-test@git.foo/bar", "{name}-{version}", str(pathlib.Path("git-test-git.foo_bar"))),
("git-test@git.foo/bar", "{name}-{version}-{/hash}", None),
("git-test@git.foo/bar", "{name}/{version}", str(pathlib.Path("git-test", "git.foo_bar"))),
# FIXME (compiler as nodes): revisit these tests
# (
# "git-test@{0}=1.0%gcc".format("a" * 40),
# "{name}/{version}/{compiler}",
# str(pathlib.Path("git-test", "{0}_1.0".format("a" * 40), "gcc")),
# ),
# (
# "git-test@git.foo/bar=1.0%gcc",
# "{name}/{version}/{compiler}",
# str(pathlib.Path("git-test", "git.foo_bar_1.0", "gcc")),
# ),
# {compiler} is 'none' if a package does not depend on C, C++, or Fortran
(
f"git-test@{'a' * 40}=1.0%gcc",
"{name}/{version}/{compiler}",
str(pathlib.Path("git-test", f"{'a' * 40}_1.0", "none")),
),
(
"git-test@git.foo/bar=1.0%gcc",
"{name}/{version}/{compiler}",
str(pathlib.Path("git-test", "git.foo_bar_1.0", "none")),
),
],
)
def test_spec_format_path(spec_str, format_str, expected, mock_git_test_package):