build: remove unused integtests

This commit is contained in:
sithlord48
2025-03-31 21:57:27 -04:00
committed by Nick Bolton
parent 0c3c913989
commit 1c907991af
7 changed files with 2 additions and 94 deletions

View File

@ -29,31 +29,14 @@ runs:
shell: bash
continue-on-error: true
- name: Integration tests
id: integtests
env:
QT_QPA_PLATFORM: offscreen
run: |
./${{ inputs.bin-dir }}/integtests
result=$?
if [ $result -ne 0 ]; then
echo "Integration tests failed with code: $result" >> $GITHUB_STEP_SUMMARY
fi
shell: bash
continue-on-error: true
- name: Get test results
id: results
run: |
pass="✅ Pass"
fail="❌ Fail"
unittests_outcome="${{ steps.unittests.outcome }}"
integtests_outcome="${{ steps.integtests.outcome }}"
unittests=$( [ "$unittests_outcome" = "success" ] && echo $pass || echo $fail )
integtests=$( [ "$integtests_outcome" = "success" ] && echo $pass || echo $fail )
echo "unittests=$unittests" >> $GITHUB_OUTPUT
echo "integtests=$integtests" >> $GITHUB_OUTPUT
shell: bash
- name: Summary row
@ -64,7 +47,6 @@ runs:
row=""
row+="| ${{ inputs.job }} "
row+="| ${{ steps.results.outputs.unittests }} "
row+="| ${{ steps.results.outputs.integtests }} |"
echo "$row" > $file
echo "file=$file" > $GITHUB_OUTPUT

View File

@ -342,8 +342,7 @@ jobs:
cmake --build build -j16
# Integration tests are flakey by nature, make them optional.
export QT_QPA_PLATFORM=offscreen
./build/bin/unittests
./build/bin/integtests || true
./build/bin/unittests || true
flatpak:
needs: lint-check
name: flatpak-${{matrix.flatpak.arch}}

View File

@ -55,17 +55,11 @@ jobs:
QT_QPA_PLATFORM: offscreen
run: cmake --build build --target coverage-unittests
- name: Integration tests coverage
env:
QT_QPA_PLATFORM: offscreen
run: cmake --build build --target coverage-integtests
- name: Get coverage report paths
id: coverage-paths
run: |
unittests=$(find build -name coverage-unittests.xml)
integtests=$(find build -name coverage-integtests.xml)
paths="${unittests}${integtests:+,$integtests}"
paths="${unittests}"
if [ -z "$paths" ]; then
echo "Error: No coverage files found"
exit 1

View File

@ -36,12 +36,6 @@ jobs:
with:
executable: ./build/bin/unittests
- name: Valgrind integration tests
id: integtests
uses: ./.github/actions/run-valgrind
with:
executable: ./build/bin/integtests
- name: Set job summary
run: |
backticks='```'
@ -52,11 +46,6 @@ jobs:
$backticks
${{ steps.unittests.outputs.summary }}
$backticks
### Integration tests
$backticks
${{ steps.integtests.outputs.summary }}
$backticks
EOF
)

View File

@ -23,7 +23,6 @@ macro(config_all_tests)
config_test_deps()
add_subdirectory(integtests)
add_subdirectory(unittests)
endmacro()

View File

@ -1,8 +0,0 @@
# SPDX-FileCopyrightText: 2012 - 2024 Symless Ltd
# SPDX-FileCopyrightText: 2009 - 2012 Nick Bolton
# SPDX-License-Identifier: MIT
config_test()
set(target integtests)
add_executable(${target} ${sources} ${headers})
target_link_libraries(${target} ${test_libs})

View File

@ -1,47 +0,0 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2011 Nick Bolton
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
*/
#include "arch/Arch.h"
#include "base/Log.h"
#include "shared/ExitTimeout.h"
#if SYSAPI_WIN32
#include "arch/win32/ArchMiscWindows.h"
#endif
#include <filesystem>
#include <gtest/gtest.h>
using deskflow::test::ExitTimeout;
const auto testDir = "tmp/test";
int main(int argc, char **argv)
{
// HACK: Unit tests should not use the filesystem.
std::filesystem::create_directories(testDir);
ExitTimeout exitTimeout(1, "Integration tests");
#if SYSAPI_WIN32
// record window instance for tray icon, etc
ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr));
#endif
Arch arch;
arch.init();
Log log;
log.setFilter(kDEBUG2);
::testing::GTEST_FLAG(throw_on_failure) = true;
testing::InitGoogleTest(&argc, argv);
// return code 1 means the test failed.
// any other non-zero code is probably a memory error.
return RUN_ALL_TESTS();
}