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

Add faketime tests #4843

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2d289c2
Add faketime tests
dudoslav Apr 2, 2024
e758a63
Format using clang-format-17
dudoslav Apr 2, 2024
1babe1e
Remove timing tests for Windows builds
dudoslav Apr 3, 2024
eadb63b
Fix portfile issues
dudoslav Apr 3, 2024
7fc4610
Rename libfaketime port
dudoslav Apr 3, 2024
55692b4
Add librt to libfaketime dependencies
dudoslav Apr 3, 2024
208b68a
Only run on Linux (remove MacOS)
dudoslav Apr 3, 2024
124e9c1
Only link rt for Linux
dudoslav Apr 3, 2024
c0e8877
Update test/CMakeLists.txt
dudoslav Apr 3, 2024
1bf263a
Update ports/README.md
dudoslav Apr 3, 2024
04f3ef7
Unstatus compressors directory. (#4842)
KiterLuc Apr 2, 2024
89d35da
Document how to build a subset of dependencies with vcpkg. (#4844)
teo-tsirpanis Apr 2, 2024
f035f31
Update dev history with 2.21.0 and 2.21.1 content. (#4847)
KiterLuc Apr 3, 2024
474fdc6
Bump dev version to 2.23.0. (#4849)
KiterLuc Apr 3, 2024
84a4e05
Improve diagnostics when an Azure endpoint is not configured. (#4845)
teo-tsirpanis Apr 3, 2024
d638fd2
Always use vcpkg. (#4570)
teo-tsirpanis Apr 3, 2024
4d248da
Do not attempt Azure shared key authentication if no account name is …
teo-tsirpanis Apr 8, 2024
1ac0b4d
Port more tests to REST CI (#4838)
ypatia Apr 9, 2024
25c90e7
Fix build errors with CMake 3.29.1. (#4859)
teo-tsirpanis Apr 9, 2024
81794b7
Increase HDFS timeout in nightlies. (#4861)
KiterLuc Apr 10, 2024
9a5985d
Support GCS service account impersonation et. al. (#4799)
teo-tsirpanis Apr 10, 2024
c11bf06
Support specifying GCP account credentials as a config option. (#4855)
teo-tsirpanis Apr 11, 2024
fc97c63
Mark the newly introduced GCS configuration options as experimental. …
teo-tsirpanis Apr 11, 2024
3eb860e
Config serialization should take into account environment variables (…
ypatia Apr 12, 2024
22953a6
Add internal Config option 'sm.memory.tracker.reporter.wait_time_ms'.…
bekadavis9 Apr 16, 2024
2ca28a2
Stabilize REST CI (#4876)
ypatia Apr 16, 2024
bde1811
Add end-to-end cloud test workflow with Microsoft Entra ID. (#4841)
robertbindar Apr 16, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/ci-linux_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ jobs:
./tiledb/test/ci/test_assert -d yes
./tiledb/test/tiledb_unit -d yes | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1'
./tiledb/tiledb/sm/filesystem/test/unit_vfs -d yes | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1'
./tiledb/test/tiledb_timing_unit -d yes | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1'

###################################################
# Stop helper processes, if applicable
Expand Down
13 changes: 7 additions & 6 deletions ports/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ After copying the port, add an entry to the table below. You should also contrib

## List of port overlays

|Port|Reason|
|----|------|
|`libmagic`|Updating to the upstream port deferred due to failures.|
|`openssl`|Pinning to OpenSSL 1.1 until we can move to 3.0 in January 2024.|
|`pcre2`|To be removed alongside libmagic.|
|`azure-storage-common-cpp`|Patching to disable default features on libxml2 (https://github.com/Azure/azure-sdk-for-cpp/pull/5221).|
| Port | Reason |
|----------------------------|---------------------------------------------------------------------------------------------------------|
| `libmagic` | Updating to the upstream port deferred due to failures. |
| `openssl` | Pinning to OpenSSL 1.1 until we can move to 3.0 in January 2024. |
| `pcre2` | To be removed alongside libmagic. |
| `azure-storage-common-cpp` | Patching to disable default features on libxml2 (https://github.com/Azure/azure-sdk-for-cpp/pull/5221). |
| `libfaketime` | Mock time in timing unit tests |
dudoslav marked this conversation as resolved.
Show resolved Hide resolved
64 changes: 64 additions & 0 deletions ports/libfaketime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
cmake_minimum_required(VERSION 3.12)

project(libfaketime VERSION 0.9.10)

add_library(
${PROJECT_NAME}
src/libfaketime.c
)

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(
${PROJECT_NAME}
rt
)
endif()

target_include_directories(${PROJECT_NAME}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
"$<INSTALL_INTERFACE:include>"
)

file(GLOB_RECURSE PUBLIC_HEADERS "src/*.h")

target_sources(
${PROJECT_NAME}
PUBLIC
FILE_SET HEADERS
BASE_DIRS src
FILES ${PUBLIC_HEADERS}
)

install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}
FILE_SET HEADERS
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(EXPORT ${PROJECT_NAME}
FILE unofficial-${PROJECT_NAME}-targets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-${PROJECT_NAME}
NAMESPACE unofficial::libfaketime::
)

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)

configure_package_config_file(
unofficial-${PROJECT_NAME}-config.cmake.in
unofficial-${PROJECT_NAME}-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-${PROJECT_NAME})

write_basic_package_version_file(
unofficial-${PROJECT_NAME}-config-version.cmake
VERSION ${CMAKE_PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)

install(FILES
${CMAKE_BINARY_DIR}/unofficial-${PROJECT_NAME}-config.cmake
${CMAKE_BINARY_DIR}/unofficial-${PROJECT_NAME}-config-version.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-${PROJECT_NAME})
27 changes: 27 additions & 0 deletions ports/libfaketime/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)

vcpkg_from_github(
dudoslav marked this conversation as resolved.
Show resolved Hide resolved
OUT_SOURCE_PATH SOURCE_PATH
REPO wolfcw/libfaketime
REF v${VERSION}
SHA512 07c431bee21e31343b680d1322dd529ea276e3cc4dbec61646c12bf5d0263163faf6186efeb36b199e24b655578a493c43e3b7a7acf8eba8b9ff84a1e94d618b
)

file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/unofficial-libfaketime-config.cmake.in" DESTINATION "${SOURCE_PATH}")

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
)

vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(
CONFIG_PATH lib/cmake/unofficial-libfaketime
PACKAGE_NAME unofficial-libfaketime)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

# Handle copyright and usage
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
5 changes: 5 additions & 0 deletions ports/libfaketime/unofficial-libfaketime-config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/unofficial-libfaketime-targets.cmake")

check_required_components("unofficial-libfaketime")
18 changes: 18 additions & 0 deletions ports/libfaketime/vcpkg.json
dudoslav marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "libfaketime",
"version": "0.9.10",
"license": "GPL-2.0-only",
"description": "libfaketime modifies the system time for a single application",
"supports": "!windows",
"homepage": "https://github.com/wolfcw/libfaketime",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
1 change: 1 addition & 0 deletions scripts/ci/build_libtiledb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ make -C tiledb install
ls -la

make -j4 -C tiledb tiledb_unit
make -j4 -C tiledb tiledb_timing_unit
make -j4 -C tiledb unit_vfs
make -j4 -C tiledb tiledb_regression
make -j4 -C tiledb all_link_complete
39 changes: 39 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,45 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU
)
endif()

# Only produce timing tests for UNIX based systems (faketime constraint)
if (NOT MSVC)
dudoslav marked this conversation as resolved.
Show resolved Hide resolved
find_package(unofficial-libfaketime REQUIRED)

# unit test executable
add_executable(
tiledb_timing_unit EXCLUDE_FROM_ALL
$<TARGET_OBJECTS:TILEDB_CORE_OBJECTS>
"src/unit-capi-metadata.cc"
"src/unit.cc"
)

target_include_directories(
tiledb_timing_unit BEFORE PRIVATE
${TILEDB_CORE_INCLUDE_DIR}
${TILEDB_EXPORT_HEADER_DIR}
)

target_link_libraries(
tiledb_timing_unit
PUBLIC
unofficial::libfaketime::libfaketime
TILEDB_CORE_OBJECTS_ILIB
TILEDB_CORE_OBJECTS
Catch2::Catch2
tiledb_test_support_lib
)

target_compile_options(tiledb_timing_unit PRIVATE -Wno-deprecated-declarations)

add_test(
NAME "tiledb_timing_unit"
COMMAND tiledb_timing_unit --durations=yes
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

set_property(TEST tiledb_timing_unit PROPERTY ENVIRONMENT_MODIFICATION "FAKETIME=set:2020-12-24 20:30:00")
endif()

add_test(
NAME "tiledb_unit"
COMMAND tiledb_unit --durations=yes
Expand Down
6 changes: 5 additions & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@
"tests": {
"description": "Build tiledb tests",
"dependencies": [
"catch2"
"catch2",
{
"name": "libfaketime",
"platform": "!windows"
}
]
},
"tools": {
Expand Down
Loading