Skip to content

Commit

Permalink
fix button behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
alph00 committed Jul 11, 2024
1 parent a1c13ee commit b9c2ed1
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Build Core Unit Test Without SPL
name: Build Core NoSPL Unit Test

on:
pull_request:
Expand Down Expand Up @@ -66,10 +66,10 @@ jobs:
with:
submodules: true

- name: Build Unit Test Without SPL
- name: Build NoSPL Unit Test
env:
BUILD_LOGTAIL: OFF
BUILD_LOGTAIL_UT: ON
BUILD_LOGTAIL_NOSPL_UT: ON
# ENABLE_COMPATIBLE_MODE: ON
ENABLE_STATIC_LINK_CRT: ON
WITHOUTGDB: ON
Expand All @@ -78,7 +78,7 @@ jobs:
# BUILD_TYPE: Debug # TODO: Uncomment when memory management is refined
run: make core

- name: Unit Test Without SPL
- name: NoSPL Unit Test
run: make unittest_core

result:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build-core-spl-ut.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@ jobs:
- name: Build SPL Unit Test
env:
BUILD_LOGTAIL: OFF
BUILD_LOGTAIL_UT: ON
BUILD_LOGTAIL_SPL_UT: ON
ENABLE_COMPATIBLE_MODE: ON
ENABLE_STATIC_LINK_CRT: ON
WITHOUTGDB: ON
ONLY_SPL_UT: ON
MAKE_JOBS: 16
# BUILD_TYPE: Debug # TODO: Uncomment when memory management is refined
run: make core
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/build-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ name: Build Core
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'example_config/**'
- 'docker/**'
- 'k8s_template/**'
- 'changes/**'
- 'licenses/**'
- 'CHANGELOG.md'
- "docs/**"
- "example_config/**"
- "docker/**"
- "k8s_template/**"
- "changes/**"
- "licenses/**"
- "CHANGELOG.md"
push:
branches:
- main
Expand All @@ -37,7 +37,7 @@ jobs:
matrix:
go-version: [1.19]
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idruns-on
runner: [ arc-runner-set-ilogtail ]
runner: [arc-runner-set-ilogtail]
fail-fast: true
steps:
- name: prepare ubuntu environment
Expand All @@ -60,15 +60,16 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Check out code
uses: actions/checkout@v4
with:
submodules: true

- name: Build Binary
env:
BUILD_LOGTAIL_UT: OFF
BUILD_LOGTAIL_NOSPL_UT: OFF
BUILD_LOGTAIL_SPL_UT: OFF
ENABLE_COMPATIBLE_MODE: ON
ENABLE_STATIC_LINK_CRT: ON
WITHOUTGDB: ON
Expand All @@ -77,7 +78,8 @@ jobs:

- name: Check compatibility
env:
BUILD_LOGTAIL_UT: OFF
BUILD_LOGTAIL_NOSPL_UT: OFF
BUILD_LOGTAIL_SPL_UT: OFF
ENABLE_COMPATIBLE_MODE: ON
ENABLE_STATIC_LINK_CRT: ON
WITHOUTGDB: ON
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ name: Build
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'example_config/**'
- 'docker/**'
- 'k8s_template/**'
- 'changes/**'
- 'licenses/**'
- 'CHANGELOG.md'
- "docs/**"
- "example_config/**"
- "docker/**"
- "k8s_template/**"
- "changes/**"
- "licenses/**"
- "CHANGELOG.md"
push:
branches:
- main
Expand All @@ -37,7 +37,7 @@ jobs:
matrix:
go-version: [1.19]
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idruns-on
runner: [ arc-runner-set-ilogtail ]
runner: [arc-runner-set-ilogtail]
fail-fast: true
steps:
- name: prepare ubuntu environment
Expand All @@ -51,7 +51,7 @@ jobs:
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
- name: Check disk space
run: |
df -hT $PWD
Expand All @@ -60,15 +60,16 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Check out code
uses: actions/checkout@v4
with:
submodules: true

- name: Build Binary
env:
BUILD_LOGTAIL_UT: OFF
BUILD_LOGTAIL_NOSPL_UT: OFF
BUILD_LOGTAIL_SPL_UT: OFF
ENABLE_COMPATIBLE_MODE: ON
ENABLE_STATIC_LINK_CRT: ON
WITHOUTGDB: ON
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/e2e-framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ name: E2E Core Test
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'example_config/**'
- 'docker/**'
- 'k8s_template/**'
- 'changes/**'
- 'licenses/**'
- 'CHANGELOG.md'
- "docs/**"
- "example_config/**"
- "docker/**"
- "k8s_template/**"
- "changes/**"
- "licenses/**"
- "CHANGELOG.md"
push:
branches:
- main
Expand All @@ -34,8 +34,8 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
go-version: [ 1.19.10 ]
runner: [ ubuntu-latest ]
go-version: [1.19.10]
runner: [ubuntu-latest]
fail-fast: true
steps:
# Clean up space to prevent action from running out of disk space.
Expand Down Expand Up @@ -69,7 +69,8 @@ jobs:
- name: E2E Plugin Framework Test
env:
BUILD_LOGTAIL_UT: OFF
BUILD_LOGTAIL_NOSPL_UT: OFF
BUILD_LOGTAIL_SPL_UT: OFF
WITHOUTGDB: ON
run: make e2e-core

Expand All @@ -81,7 +82,7 @@ jobs:
result:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [ CI ]
needs: [CI]
steps:
- name: Build Result
run: echo "Just to make the GitHub merge button green"
23 changes: 12 additions & 11 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ name: E2E Test
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'example_config/**'
- 'docker/**'
- 'k8s_template/**'
- 'changes/**'
- 'licenses/**'
- 'CHANGELOG.md'
- "docs/**"
- "example_config/**"
- "docker/**"
- "k8s_template/**"
- "changes/**"
- "licenses/**"
- "CHANGELOG.md"
push:
branches:
- main
Expand All @@ -34,8 +34,8 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
go-version: [ 1.19.10 ]
runner: [ ubuntu-latest ]
go-version: [1.19.10]
runner: [ubuntu-latest]
fail-fast: true
steps:
# Clean up space to prevent action from running out of disk space.
Expand Down Expand Up @@ -76,14 +76,15 @@ jobs:
- name: E2E Behavior Test
env:
BUILD_LOGTAIL_UT: OFF
BUILD_LOGTAIL_NOSPL_UT: OFF
BUILD_LOGTAIL_SPL_UT: OFF
WITHOUTGDB: ON
run: make e2e

result:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [ CI ]
needs: [CI]
steps:
- name: Build Result
run: echo "Just to make the GitHub merge button green"
8 changes: 4 additions & 4 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ option(ENABLE_ENTERPRISE "enable enterprise feature")
cmake_dependent_option(ENABLE_COMPATIBLE_MODE "Build Logtail in compatible mode (for low version Linux)" OFF "LINUX" OFF)
cmake_dependent_option(ENABLE_STATIC_LINK_CRT "Build Logtail by linking CRT statically" OFF "LINUX" OFF)
option(WITHOUTGDB "Build Logtail without gdb")
option(WITHOUTSPL "Build Logtail and UT without SPL")
option(BUILD_LOGTAIL_UT "Build unit test for Logtail")
option(ONLY_SPL_UT "Only build UT with SPL")
option(WITHOUTSPL "Link Logtail without SPL")
option(BUILD_LOGTAIL_NOSPL_UT "Build noSPL unit test for Logtail")
option(BUILD_LOGTAIL_SPL_UT "Build SPL unit test for Logtail")

if (ENABLE_ENTERPRISE)
message(STATUS "Enable Enterprise Feature.")
Expand Down Expand Up @@ -207,7 +207,7 @@ if (BUILD_LOGTAIL_SHARED_LIBRARY)
endif ()

# Logtail UT.
if (BUILD_LOGTAIL_UT)
if (BUILD_LOGTAIL_NOSPL_UT OR BUILD_LOGTAIL_SPL_UT)
message(STATUS "Build unittest.")
include(CTest)
enable_testing()
Expand Down
2 changes: 1 addition & 1 deletion core/links.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

macro(all_link target_name)
if (BUILD_LOGTAIL_UT)
if (BUILD_LOGTAIL_NOSPL_UT OR BUILD_LOGTAIL_SPL_UT)
link_gtest(${target_name})
endif ()
link_protobuf(${target_name})
Expand Down
14 changes: 7 additions & 7 deletions core/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ flusher_link(${PROJECT_NAME})
all_link(${PROJECT_NAME})
common_link(${PROJECT_NAME})

if(NOT ONLY_SPL_UT)
if(BUILD_LOGTAIL_NOSPL_UT)
add_subdirectory(app_config)
add_subdirectory(batch)
add_subdirectory(checkpoint)
Expand All @@ -72,13 +72,13 @@ if(NOT ONLY_SPL_UT)
add_subdirectory(sdk)
add_subdirectory(sender)
add_subdirectory(serializer)
if (LINUX)
add_subdirectory(observer)
endif ()
endif()

if (LINUX)
if (NOT WITHOUTSPL)
if(BUILD_LOGTAIL_SPL_UT)
if (LINUX)
add_subdirectory(spl)
endif ()
if (NOT ONLY_SPL_UT)
add_subdirectory(observer)
endif()
endif ()
endif()
4 changes: 2 additions & 2 deletions docs/cn/developer-guide/development-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ cmake -D CMAKE_BUILD_TYPE=Debug ..

同理,若需要明确需要代码优化,则将上面的Debug改为Release。

默认的编译开关没有打开UT,如果需要编译UT,需要增加BUILD_LOGTAIL_UT开关。替换上述第2行为
默认的编译开关没有打开UT,如果需要编译UT,需要增加BUILD_LOGTAIL_NOSPL_UT或BUILD_LOGTAIL_SPL_UT开关。替换上述第2行为

```bash
cmake -DBUILD_LOGTAIL_UT=ON ..
cmake -DBUILD_LOGTAIL_NOSPL_UT=ON ..
```

- 制作镜像
Expand Down
13 changes: 7 additions & 6 deletions scripts/gen_build_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ GO_MOD_FILE=${9:-${GO_MOD_FILE:-go.mod}}

BUILD_TYPE=${BUILD_TYPE:-Release}
BUILD_LOGTAIL=${BUILD_LOGTAIL:-ON}
BUILD_LOGTAIL_UT=${BUILD_LOGTAIL_UT:-OFF}
BUILD_LOGTAIL_NOSPL_UT=${BUILD_LOGTAIL_NOSPL_UT:-OFF}
BUILD_LOGTAIL_SPL_UT=${BUILD_LOGTAIL_SPL_UT:-OFF}
ENABLE_COMPATIBLE_MODE=${ENABLE_COMPATIBLE_MODE:-OFF}
ENABLE_STATIC_LINK_CRT=${ENABLE_STATIC_LINK_CRT:-OFF}
WITHOUTGDB==${WITHOUTGDB:-OFF}
Expand Down Expand Up @@ -84,11 +85,11 @@ EOF
if [ $CATEGORY = "plugin" ]; then
echo "mkdir -p core/build && cd core/build && cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLOGTAIL_VERSION=${VERSION} .. && cd plugin && make -s PluginAdapter && cd ../../.. && ./scripts/upgrade_adapter_lib.sh && ./scripts/plugin_build.sh mod c-shared ${OUT_DIR} ${VERSION} ${PLUGINS_CONFIG_FILE} ${GO_MOD_FILE}" >>$BUILD_SCRIPT_FILE
elif [ $CATEGORY = "core" ]; then
echo "mkdir -p core/build && cd core/build && cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLOGTAIL_VERSION=${VERSION} -DBUILD_LOGTAIL=${BUILD_LOGTAIL} -DBUILD_LOGTAIL_UT=${BUILD_LOGTAIL_UT} -DENABLE_COMPATIBLE_MODE=${ENABLE_COMPATIBLE_MODE} -DENABLE_STATIC_LINK_CRT=${ENABLE_STATIC_LINK_CRT} -DWITHOUTGDB=${WITHOUTGDB} -DWITHOUTSPL=${WITHOUTSPL} -DONLY_SPL_UT=${ONLY_SPL_UT} .. && make -sj${MAKE_JOBS}" >>$BUILD_SCRIPT_FILE
echo "mkdir -p core/build && cd core/build && cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLOGTAIL_VERSION=${VERSION} -DBUILD_LOGTAIL=${BUILD_LOGTAIL} -DBUILD_LOGTAIL_NOSPL_UT=${BUILD_LOGTAIL_NOSPL_UT} -DBUILD_LOGTAIL_SPL_UT=${BUILD_LOGTAIL_SPL_UT} -DENABLE_COMPATIBLE_MODE=${ENABLE_COMPATIBLE_MODE} -DENABLE_STATIC_LINK_CRT=${ENABLE_STATIC_LINK_CRT} -DWITHOUTGDB=${WITHOUTGDB} -DWITHOUTSPL=${WITHOUTSPL} -DONLY_SPL_UT=${ONLY_SPL_UT} .. && make -sj${MAKE_JOBS}" >>$BUILD_SCRIPT_FILE
elif [ $CATEGORY = "all" ]; then
echo "mkdir -p core/build && cd core/build && cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLOGTAIL_VERSION=${VERSION} -DBUILD_LOGTAIL_UT=${BUILD_LOGTAIL_UT} -DENABLE_COMPATIBLE_MODE=${ENABLE_COMPATIBLE_MODE} -DENABLE_STATIC_LINK_CRT=${ENABLE_STATIC_LINK_CRT} -DWITHOUTGDB=${WITHOUTGDB} .. && make -sj\$nproc && cd - && ./scripts/upgrade_adapter_lib.sh && ./scripts/plugin_build.sh mod c-shared ${OUT_DIR} ${VERSION} ${PLUGINS_CONFIG_FILE} ${GO_MOD_FILE}" >>$BUILD_SCRIPT_FILE
echo "mkdir -p core/build && cd core/build && cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLOGTAIL_VERSION=${VERSION} -DBUILD_LOGTAIL_NOSPL_UT=${BUILD_LOGTAIL_NOSPL_UT} -DBUILD_LOGTAIL_SPL_UT=${BUILD_LOGTAIL_SPL_UT} -DENABLE_COMPATIBLE_MODE=${ENABLE_COMPATIBLE_MODE} -DENABLE_STATIC_LINK_CRT=${ENABLE_STATIC_LINK_CRT} -DWITHOUTGDB=${WITHOUTGDB} .. && make -sj\$nproc && cd - && ./scripts/upgrade_adapter_lib.sh && ./scripts/plugin_build.sh mod c-shared ${OUT_DIR} ${VERSION} ${PLUGINS_CONFIG_FILE} ${GO_MOD_FILE}" >>$BUILD_SCRIPT_FILE
elif [ $CATEGORY = "e2e" ]; then
echo "mkdir -p core/build && cd core/build && cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLOGTAIL_VERSION=${VERSION} -DBUILD_LOGTAIL_UT=${BUILD_LOGTAIL_UT} -DENABLE_COMPATIBLE_MODE=${ENABLE_COMPATIBLE_MODE} -DENABLE_STATIC_LINK_CRT=${ENABLE_STATIC_LINK_CRT} -DWITHOUTGDB=${WITHOUTGDB} .. && make -sj\$nproc && cd - && ./scripts/plugin_gocbuild.sh ${OUT_DIR} ${PLUGINS_CONFIG_FILE} ${GO_MOD_FILE}" >>$BUILD_SCRIPT_FILE
echo "mkdir -p core/build && cd core/build && cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLOGTAIL_VERSION=${VERSION} -DBUILD_LOGTAIL_NOSPL_UT=${BUILD_LOGTAIL_NOSPL_UT} -DBUILD_LOGTAIL_SPL_UT=${BUILD_LOGTAIL_SPL_UT} -DENABLE_COMPATIBLE_MODE=${ENABLE_COMPATIBLE_MODE} -DENABLE_STATIC_LINK_CRT=${ENABLE_STATIC_LINK_CRT} -DWITHOUTGDB=${WITHOUTGDB} .. && make -sj\$nproc && cd - && ./scripts/plugin_gocbuild.sh ${OUT_DIR} ${PLUGINS_CONFIG_FILE} ${GO_MOD_FILE}" >>$BUILD_SCRIPT_FILE
fi
}

Expand All @@ -105,14 +106,14 @@ function generateCopyScript() {
echo 'docker cp "$id":/src/core/build/ilogtail $BINDIR' >>$COPY_SCRIPT_FILE
echo 'docker cp "$id":/src/core/build/go_pipeline/libPluginAdapter.so $BINDIR' >>$COPY_SCRIPT_FILE
fi
if [ $BUILD_LOGTAIL_UT = "ON" ]; then
if [ $BUILD_LOGTAIL_NOSPL_UT = "ON" ] || [ $BUILD_LOGTAIL_SPL_UT = "ON"]; then
echo 'docker cp "$id":/src/core/build core/build' >>$COPY_SCRIPT_FILE
fi
else
echo 'docker cp "$id":/src/'${OUT_DIR}'/libPluginBase.so $BINDIR' >>$COPY_SCRIPT_FILE
echo 'docker cp "$id":/src/core/build/ilogtail $BINDIR' >>$COPY_SCRIPT_FILE
echo 'docker cp "$id":/src/core/build/go_pipeline/libPluginAdapter.so $BINDIR' >>$COPY_SCRIPT_FILE
if [ $BUILD_LOGTAIL_UT = "ON" ]; then
if [ $BUILD_LOGTAIL_NOSPL_UT = "ON" ] || [ $BUILD_LOGTAIL_SPL_UT = "ON"]; then
echo 'docker cp "$id":/src/core/build core/build' >>$COPY_SCRIPT_FILE
fi
fi
Expand Down

0 comments on commit b9c2ed1

Please sign in to comment.