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

Skip MinIO test when the MinIO playground is not responding or filled up #1068

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- Mode: cmake -*-
#
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.16)

project(dlite
VERSION 0.5.26
Expand Down
13 changes: 13 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,22 @@ if(FORCE_EXAMPLES OR EXISTS ${CMAKE_INSTALL_PREFIX}/share/dlite/examples)
SKIP_RETURN_CODE 44)
endforeach()


# Special properties on minio_storage for not hanging when the MinIO
# playground is not responding or when the storage is full
set_property(TEST minio_storage APPEND PROPERTY
ENVIRONMENT "TIMEOUT=5"
)
set_property(TEST minio_storage PROPERTY
SKIP_REGULAR_EXPRESSION "(XMinioStorageFull)|(subprocess.TimeoutExpired)"
)

endif()





install(
DIRECTORY ex1 ex2 ex3 ex4 ex5d read-csv dehydrogenation
DESTINATION share/dlite/examples
Expand Down
9 changes: 7 additions & 2 deletions examples/minio_storage/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import sys
import subprocess
from pathlib import Path
Expand All @@ -10,5 +11,9 @@

thisdir = Path(__file__).resolve().parent

subprocess.check_call(args=[sys.executable, f"{thisdir}/store.py"])
subprocess.check_call(args=[sys.executable, f"{thisdir}/fetch.py"])
# Get timeout from the environment
timeout_str = os.getenv("TIMEOUT", None)
timeout = float(timeout_str) if timeout_str else None

subprocess.check_call([sys.executable, f"{thisdir}/store.py"], timeout=timeout)
subprocess.check_call([sys.executable, f"{thisdir}/fetch.py"], timeout=timeout)
6 changes: 6 additions & 0 deletions storages/python/tests-python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,9 @@ foreach(test ${python-tests})
set_property(TEST ${test} PROPERTY SKIP_RETURN_CODE 44)

endforeach()


# Skip minio test if the minio playground storage is full
set_property(TEST test_minio PROPERTY
SKIP_REGULAR_EXPRESSION "XMinioStorageFull"
)
Loading