From 459ae8279d0adf170fde3e35890bd990097d2d1d Mon Sep 17 00:00:00 2001 From: aaron57 Date: Wed, 7 Aug 2024 17:10:53 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[Huawei]=20=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Offering:SmartPerf-Host 单元测试日志 --- trace_streamer/test/unittest/ebpf/bio_parser_test.cpp | 1 + trace_streamer/test/unittest/ebpf/ebpf_file_system_test.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/trace_streamer/test/unittest/ebpf/bio_parser_test.cpp b/trace_streamer/test/unittest/ebpf/bio_parser_test.cpp index 782449d81..74e460dae 100644 --- a/trace_streamer/test/unittest/ebpf/bio_parser_test.cpp +++ b/trace_streamer/test/unittest/ebpf/bio_parser_test.cpp @@ -55,6 +55,7 @@ public: void InitData(uint32_t length, uint32_t nips, const uint64_t startTime, const uint64_t endTime, uint32_t prio = 0) { + TS_LOGI("InitData"); ebpfHeader_.header.clock = EBPF_CLOCK_BOOTTIME; ebpfHeader_.header.cmdLineLen = COMMAND_LINE.length(); strcpy_s(ebpfHeader_.cmdline, EBPF_COMMAND_MAX_SIZE, COMMAND_LINE.c_str()); diff --git a/trace_streamer/test/unittest/ebpf/ebpf_file_system_test.cpp b/trace_streamer/test/unittest/ebpf/ebpf_file_system_test.cpp index 8a961f7af..552fd341e 100644 --- a/trace_streamer/test/unittest/ebpf/ebpf_file_system_test.cpp +++ b/trace_streamer/test/unittest/ebpf/ebpf_file_system_test.cpp @@ -51,6 +51,7 @@ class EbpfFileSystemTest : public ::testing::Test { public: void SetUp() { + TS_LOGI("EbpfFileSystemTest SetUp"); stream_.InitFilter(); parser_ = std::make_unique(stream_.traceDataCache_.get(), stream_.streamFilters_.get()); @@ -68,6 +69,7 @@ public: void InitData(uint16_t nrUserIPs = IPS_NUM_00) { + TS_LOGI("EbpfFileSystemTest InitData"); fsFixedHeader_.pid = PID_01; fsFixedHeader_.tid = TID_01; fsFixedHeader_.startTime = START_TIME_01; @@ -82,6 +84,7 @@ public: void ResetData() { + TS_LOGI("EbpfFileSystemTest ResetData"); fsFixedHeader_.pid = PID_02; fsFixedHeader_.tid = TID_02; fsFixedHeader_.startTime = START_TIME_02; @@ -96,6 +99,7 @@ public: void UpdateData() { + TS_LOGI("EbpfFileSystemTest UpdateData"); dequeBuffer_.insert(dequeBuffer_.end(), reinterpret_cast(&ebpfTypeAndLength_), reinterpret_cast(&ebpfTypeAndLength_ + 1)); dequeBuffer_.insert(dequeBuffer_.end(), reinterpret_cast(&fsFixedHeader_), -- Gitee From 115b443b35f872df2c3b3049cc4b5a94bde42eb6 Mon Sep 17 00:00:00 2001 From: frank-huangran Date: Wed, 7 Aug 2024 17:42:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E2=80=99statistics-feat=E2=80=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: frank-huangran --- ide/test/statistics/util/SpStatisticsHttpUtil.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ide/test/statistics/util/SpStatisticsHttpUtil.test.ts b/ide/test/statistics/util/SpStatisticsHttpUtil.test.ts index e743e6b28..da1ededb1 100644 --- a/ide/test/statistics/util/SpStatisticsHttpUtil.test.ts +++ b/ide/test/statistics/util/SpStatisticsHttpUtil.test.ts @@ -34,7 +34,6 @@ describe('SpStatisticsHttpUtil Test', () => { } }, })); - global.XMLHttpRequest = mockXMLHttpRequest; // Mock fetch originalFetch = global.fetch; -- Gitee From 5db977d833bef29379088d32f3bcfecfe42798dd Mon Sep 17 00:00:00 2001 From: frank-huangran Date: Wed, 7 Aug 2024 17:49:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E2=80=99idetest-feat=E2=80=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: frank-huangran --- ide/test/statistics/util/SpStatisticsHttpUtil.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ide/test/statistics/util/SpStatisticsHttpUtil.test.ts b/ide/test/statistics/util/SpStatisticsHttpUtil.test.ts index da1ededb1..20f68f627 100644 --- a/ide/test/statistics/util/SpStatisticsHttpUtil.test.ts +++ b/ide/test/statistics/util/SpStatisticsHttpUtil.test.ts @@ -20,6 +20,8 @@ describe('SpStatisticsHttpUtil Test', () => { let mockXMLHttpRequest; let originalFetch; let mockFetch; + let originalXMLHttp; + let mockXMLHttp; beforeAll(() => { // Mock XMLHttpRequest @@ -54,6 +56,7 @@ describe('SpStatisticsHttpUtil Test', () => { afterAll(() => { global.XMLHttpRequest = originalXMLHttpRequest; global.fetch = originalFetch; + global.XMLHttp = originalXMLHttp }); afterEach(() => { mockXMLHttpRequest.mockClear(); -- Gitee