Skip to content

Commit

Permalink
tests: runtime: Migrate old tests to use SKIP_IF_ENV_HAS
Browse files Browse the repository at this point in the history
Localized is better for commenting.
  • Loading branch information
danobi committed Mar 21, 2024
1 parent 68c4e32 commit 96afe1e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 17 deletions.
2 changes: 0 additions & 2 deletions .github/include/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
CXX = os.environ.get("CXX", "c++")
GTEST_COLOR = os.environ.get("GTEST_COLOR", "auto")
CI = os.environ.get("CI", "false")
RUNTIME_TEST_DISABLE = os.environ.get("RUNTIME_TEST_DISABLE", "")
RUNTIME_TEST_COLOR = os.environ.get("RUNTIME_TEST_COLOR", "auto")
TOOLS_TEST_OLDVERSION = os.environ.get("TOOLS_TEST_OLDVERSION", "")
TOOLS_TEST_DISABLE = os.environ.get("TOOLS_TEST_DISABLE", "")
Expand Down Expand Up @@ -253,7 +252,6 @@ def test():
cwd=Path(BUILD_DIR),
env={
"CI": CI,
"RUNTIME_TEST_DISABLE": RUNTIME_TEST_DISABLE,
"RUNTIME_TEST_COLOR": RUNTIME_TEST_COLOR,
},
),
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,63 +31,53 @@ jobs:
- NAME: LLVM 10 Release
CMAKE_BUILD_TYPE: Release
NIX_TARGET: .#bpftrace-llvm10
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size,usdt.usdt probes - file based semaphore activation multi process
TOOLS_TEST_OLDVERSION: tcpdrop.bt
TOOLS_TEST_DISABLE: biosnoop.bt
- NAME: LLVM 11 Release
CMAKE_BUILD_TYPE: Release
NIX_TARGET: .#bpftrace-llvm11
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size,usdt.usdt probes - file based semaphore activation multi process
TOOLS_TEST_OLDVERSION: tcpdrop.bt
TOOLS_TEST_DISABLE: biosnoop.bt
- NAME: LLVM 12 Release
CMAKE_BUILD_TYPE: Release
NIX_TARGET: .#bpftrace-llvm12
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size,usdt.usdt probes - file based semaphore activation multi process
TOOLS_TEST_OLDVERSION: tcpdrop.bt
TOOLS_TEST_DISABLE: biosnoop.bt
- NAME: LLVM 13 Release
CMAKE_BUILD_TYPE: Release
NIX_TARGET: .#bpftrace-llvm13
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size,usdt.usdt probes - file based semaphore activation multi process
TOOLS_TEST_OLDVERSION: tcpdrop.bt
TOOLS_TEST_DISABLE: biosnoop.bt
- NAME: LLVM 14 Release
CMAKE_BUILD_TYPE: Release
NIX_TARGET: .#bpftrace-llvm14
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size,usdt.usdt probes - file based semaphore activation multi process
TOOLS_TEST_OLDVERSION: tcpdrop.bt
TOOLS_TEST_DISABLE: biosnoop.bt
- NAME: LLVM 15 Release
CMAKE_BUILD_TYPE: Release
NIX_TARGET: .#bpftrace-llvm15
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size,usdt.usdt probes - file based semaphore activation multi process
TOOLS_TEST_OLDVERSION: tcpdrop.bt
TOOLS_TEST_DISABLE: biosnoop.bt
- NAME: LLVM 16 Release
CMAKE_BUILD_TYPE: Release
NIX_TARGET: .#bpftrace-llvm16
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size,usdt.usdt probes - file based semaphore activation multi process
TOOLS_TEST_OLDVERSION: tcpdrop.bt
TOOLS_TEST_DISABLE: biosnoop.bt
- NAME: LLVM 17 Release
CMAKE_BUILD_TYPE: Release
NIX_TARGET: .#bpftrace-llvm17
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size,usdt.usdt probes - file based semaphore activation multi process
TOOLS_TEST_OLDVERSION: tcpdrop.bt
TOOLS_TEST_DISABLE: biosnoop.bt
- NAME: LLVM 17 Debug
CMAKE_BUILD_TYPE: Debug
NIX_TARGET: .#bpftrace-llvm17
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size,usdt.usdt probes - file based semaphore activation multi process
TOOLS_TEST_OLDVERSION: tcpdrop.bt
TOOLS_TEST_DISABLE: biosnoop.bt
- NAME: LLVM 17 Clang Debug
CMAKE_BUILD_TYPE: Debug
NIX_TARGET: .#bpftrace-llvm17
CC: clang
CXX: clang++
RUNTIME_TEST_DISABLE: probe.kprobe_offset_fail_size,usdt.usdt probes - file based semaphore activation multi process
TOOLS_TEST_OLDVERSION: tcpdrop.bt
TOOLS_TEST_DISABLE: biosnoop.bt
- NAME: Memleak test (LLVM 11 Debug)
Expand Down
5 changes: 0 additions & 5 deletions tests/runtime/engine/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,6 @@ def run_test(test):
print(warn("[ SKIP ] ") + "%s.%s" % (test.suite, test.name))
return Runner.SKIP_KERNEL_VERSION_MAX

full_test_name = test.suite + "." + test.name
if full_test_name in os.getenv("RUNTIME_TEST_DISABLE", "").split(","):
print(warn("[ SKIP ] ") + "%s.%s" % (test.suite, test.name))
return Runner.SKIP_ENVIRONMENT_DISABLED

if test.skip_if_env_has and os.environ.get(test.skip_if_env_has[0], '') == test.skip_if_env_has[1]:
print(warn("[ SKIP ] ") + "%s.%s" % (test.suite, test.name))
return Runner.SKIP_ENVIRONMENT_DISABLED
Expand Down
2 changes: 2 additions & 0 deletions tests/runtime/probe
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ PROG kprobe:vfs_read+1000000 { printf("SUCCESS %d\n", pid); exit(); }
EXPECT_REGEX Offset outside the function bounds \('vfs_read' size is*
TIMEOUT 5
WILL_FAIL
# See https://github.com/bpftrace/bpftrace/pull/956
SKIP_IF_ENV_HAS CI=true

NAME kprobe_offset_module
RUN {{BPFTRACE}} -e 'kprobe:nft_trans_alloc_gfp+0x5 { printf("hit\n"); exit(); }'
Expand Down
2 changes: 2 additions & 0 deletions tests/runtime/usdt
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ TIMEOUT 5
BEFORE ./testprogs/usdt_semaphore_test
BEFORE ./testprogs/usdt_semaphore_test
REQUIRES ./testprogs/systemtap_sys_sdt_check
# See https://github.com/bpftrace/bpftrace/pull/2438
SKIP_IF_ENV_HAS CI=true

NAME usdt probes - list probes by pid in separate mountns
RUN {{BPFTRACE}} -l 'usdt:*' -p {{BEFORE_PID}}
Expand Down

0 comments on commit 96afe1e

Please sign in to comment.