Skip to content

Commit

Permalink
Merge pull request #128 from TGSAI/105_integration_UX
Browse files Browse the repository at this point in the history
Improve user experience for integration test failures
  • Loading branch information
markspec authored Oct 22, 2024
2 parents 7b20658 + 727ff91 commit 03456ed
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Welcome to **MDIO** - a descriptive format for energy data that is intended to r

## Optional tools (Integration)
- Python module xarray version 2024.6.0 *or better*
- Python module zarr version 2.18.2 *or better*

# Getting Started

Expand Down
6 changes: 5 additions & 1 deletion mdio/acceptance_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ TEST(Variable, sliceByDimIdx) {
<< voidedSlice.value().dimensions();
}

TEST(Variable, xarrayCompatibility) {
TEST(Variable, zarrCompatibility) {
const char* basePath = std::getenv("PROJECT_BASE_PATH");
if (!basePath) {
std::cout << "PROJECT_BASE_PATH environment variable not set. Expecting to "
Expand Down Expand Up @@ -1663,6 +1663,10 @@ TEST(Dataset, xarrayCompatible) {
std::string datasetPath = "./zarrs/acceptance";
std::string command = "python3 " + srcPath + " " + datasetPath + " False";
int status = system(command.c_str());
if (status == 0xfd00) { // 0xfd from Python is 0xfd00 in C++
GTEST_SKIP()
<< "Xarray compatibility skipped due to import error for xarray";
}
ASSERT_TRUE(status == 0)
<< "xarray compatibility test failed without consolidated "
"metadata\n\tThere was some expected output above...";
Expand Down
6 changes: 5 additions & 1 deletion mdio/regression_tests/xarray_compatibility_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import argparse
import sys
import xarray as xr
try:
import xarray as xr
except ImportError:
print("Failed to import xarray.")
sys.exit(0xfd) # 64768


def test_xarray_dataset(file_path, consolidated_metadata):
Expand Down
6 changes: 5 additions & 1 deletion mdio/regression_tests/zarr_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

import argparse
import sys
import zarr
try:
import zarr
except ImportError:
print("Failed to import zarr.")
sys.exit(0xfd)


def test_zarr_dataset(file_path):
Expand Down

0 comments on commit 03456ed

Please sign in to comment.