Skip to content

Commit

Permalink
test[dace]: Add skip rules for dace optional dependency (#1635)
Browse files Browse the repository at this point in the history
Tests that depend on dace should check if dace is installed, because
dace is an optional dependency. Error detected in spack-c2sm CI where
dace is not installed.
Additionally, added `requires_dace` marker to filter the testcases.
  • Loading branch information
edopao authored Sep 9, 2024
1 parent 70dd7c3 commit 42636f7
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,8 @@
from typing import Any, Optional, Sequence, Union, overload, Literal, Generator

import pytest
import dace
import copy
import numpy as np
from dace.sdfg import nodes as dace_nodes
from dace.transformation import dataflow as dace_dataflow

from gt4py.next import common as gtx_common
from gt4py.next.program_processors.runners.dace_fieldview import (
transformations as gtx_transformations,
)
dace = pytest.importorskip("dace")


@pytest.fixture()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
)
from . import util

pytestmark = pytest.mark.usefixtures("set_dace_settings")
pytestmark = [pytest.mark.requires_dace, pytest.mark.usefixtures("set_dace_settings")]


def _get_trivial_gpu_promotable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
)
from . import util

pytestmark = pytest.mark.usefixtures("set_dace_settings")
pytestmark = [pytest.mark.requires_dace, pytest.mark.usefixtures("set_dace_settings")]


def _get_simple_sdfg() -> tuple[dace.SDFG, Callable[[np.ndarray, np.ndarray], np.ndarray]]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)
from . import util

pytestmark = pytest.mark.usefixtures("set_dace_settings")
pytestmark = [pytest.mark.requires_dace, pytest.mark.usefixtures("set_dace_settings")]


def _make_serial_sdfg_1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from . import util


pytestmark = pytest.mark.usefixtures("set_dace_settings")
pytestmark = [pytest.mark.requires_dace, pytest.mark.usefixtures("set_dace_settings")]


def test_serial_map_promotion():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
exec_alloc_descriptor,
)

pytestmark = pytest.mark.requires_dace
compiled_sdfg = pytest.importorskip("dace.codegen.compiled_sdfg")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
from gt4py.next import common as gtx_common
from gt4py.next.iterator import ir as gtir
from gt4py.next.iterator.ir_utils import ir_makers as im
from gt4py.next.iterator.type_system import type_specifications as gtir_ts
from gt4py.next.program_processors.runners import dace_fieldview as dace_backend
from gt4py.next.type_system import type_specifications as ts
from next_tests.integration_tests.feature_tests.ffront_tests.ffront_test_utils import (
Cell,
Expand All @@ -34,6 +32,7 @@
import pytest

pytestmark = pytest.mark.requires_dace
dace_backend = pytest.importorskip("gt4py.next.program_processors.runners.dace_fieldview")


N = 10
Expand Down

0 comments on commit 42636f7

Please sign in to comment.