-
Notifications
You must be signed in to change notification settings - Fork 391
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
speedup CI UT job #1606
speedup CI UT job #1606
Conversation
core/CMakeLists.txt
Outdated
@@ -149,6 +158,7 @@ if(MSVC) | |||
file(GLOB REMOVE_EVENT_LISTENER_SOURCES event_listener/*_Linux.cpp event_listener/*_Linux.h) | |||
list(REMOVE_ITEM SOURCE_FILES_LIST ${REMOVE_EVENT_LISTENER_SOURCES}) | |||
set(WINDOWS_SOURCE_FILES ${SOURCE_FILES_LIST} ${SUBDIR_SOURCE_FILES}) | |||
set(NOSPL_WINDOWS_SOURCE_FILES ${SOURCE_FILES_LIST} ${NOSPL_SUBDIR_SOURCE_FILES}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命名不太统一,NOSPL跟WITHOUTSPL是一个事情?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOSPL_WINDOWS_SOURCE_FILES NOSPL 用后缀表示更好些?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOSPL 是表示生成不含有SPL的单元测试,WITHOUTSPL 表示的是在生成产物过程中是否链接SPL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经重新命名并实现
core/unittest/CMakeLists.txt
Outdated
add_subdirectory(sdk) | ||
add_subdirectory(sender) | ||
add_subdirectory(serializer) | ||
macro(add_nospl_subdir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里除spl外所有的目录,用nospl表示不合适吧。如果后面再加个特殊的组件还能表示的了? 其他地方类似。
从base、spl、另外再有个类似,三个类似的角度来考虑这个问题。
整体的变量命名需要考虑下。所以不应该出现nospl、without这种命名。应该是base 加 增量的关系
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经重新命名并实现
… one without SPL fix: change design. Build .a and .so at the same CI UT job
1868ae3
to
5b11b0a
Compare
core/CMakeLists.txt
Outdated
endif() | ||
set(SRC_FILES ${SRC_FILES} ${SOURCE_FILES_LIST} ${SUBDIR_SOURCE_FILES_CORE}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SOURCE_FILES_LIST能换个名字吗?比如CORE_SOURCE_FILES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已改为 FRAMEWORK_SOURCE_FILES
core/CMakeLists.txt
Outdated
@@ -92,7 +100,8 @@ endif () | |||
include(${CMAKE_CURRENT_SOURCE_DIR}/utils.cmake) | |||
include(${CMAKE_CURRENT_SOURCE_DIR}/dependencies.cmake) | |||
include(${CMAKE_CURRENT_SOURCE_DIR}/links.cmake) | |||
set(SUBDIR_SOURCE_FILES "") | |||
set(SUBDIR_SOURCE_FILES_CORE "") | |||
set(SUBDIR_SOURCE_FILES_SPL "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPL_SOURCE_FILES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改为PLUGIN_SOURCE_FILES_SPL
core/CMakeLists.txt
Outdated
@@ -92,7 +100,8 @@ endif () | |||
include(${CMAKE_CURRENT_SOURCE_DIR}/utils.cmake) | |||
include(${CMAKE_CURRENT_SOURCE_DIR}/dependencies.cmake) | |||
include(${CMAKE_CURRENT_SOURCE_DIR}/links.cmake) | |||
set(SUBDIR_SOURCE_FILES "") | |||
set(SUBDIR_SOURCE_FILES_CORE "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个最终应该叫PLUGIN_SOURCE_FILES,只包括input、processor和flusher目录下的文件
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改为PLUGIN_SOURCE_FILES_CORE
option(BUILD_LOGTAIL_UT "Build unit test for Logtail") | ||
|
||
if (BUILD_LOGTAIL_SHARED_LIBRARY AND WITHSPL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BUILD_LOGTAIL_SHARED_LIBRARY 注释说明下应用场景
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码注释,不是评论注释。说明下什么场景会用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
commit c8385ca Author: henryzhx8 <zhhxjack8@aliyun.com> Date: Fri Jul 19 09:42:31 2024 +0800 fix core caused by concurrent use of non-thread-safe gethostbyname (alibaba#1611) * fix core caused by concurrent use of non-thread-safe gethostbyname commit 8fc252e Author: Qiu Fengshuo <alph000@163.com> Date: Thu Jul 18 09:42:06 2024 +0800 speedup CI UT job (alibaba#1606) * Split the original UT CI job into two separate jobs: one with SPL and one without SPL * fix: change design. Build .a and .so at the same CI UT job * fix * fix * fix * fix * fix * fix * fix
思路:将原来的 CI UT job 拆分到只有 SPL 和无 SPL 的2个 job,这样其他 UT 就不需要静态链接一个相当大的 unittest_base.a
修改后的最终思路:仍然保持一个 CI UT job,同时编译出只有 SPL 和没有 SPL 的2个 unittest_base ,非 SPL UT 链接时就不需要再反复链接大体积静态库
效果:CI UT job需要的时间从原来的40min以上可以降低到10min左右