Skip to content
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

Add boot testing to release builds #12374

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ jobs:
working-directory: ${{ runner.temp }}\shadow_build_dir
run: cmake --build . --target all --config ${{ matrix.BuildType }}

- name: Sanity check release builds
if: matrix.BuildType == 'Release'
working-directory: ${{ runner.temp }}/shadow_build_dir/Release
env:
QT_QUICK_BACKEND: "software"
QT_QPA_PLATFORM: "offscreen"
run: QGroundControl.exe --release-boot-test

- name: Install
working-directory: ${{ runner.temp }}\shadow_build_dir
run: cmake --install . --config ${{ matrix.BuildType }}
Expand Down
18 changes: 9 additions & 9 deletions src/QGCApplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,18 @@ QGCApplication::QGCApplication(int &argc, char *argv[], bool unitTesting)
QNetworkProxyFactory::setUseSystemConfiguration(true);

// Parse command line options
bool fClearSettingsOptions = false; // Clear stored settings
bool fClearCache = false; // Clear parameter/airframe caches
bool logging = false; // Turn on logging
bool fClearSettingsOptions = false; // Clear stored settings
bool fClearCache = false; // Clear parameter/airframe caches
bool logging = false; // Turn on logging
QString loggingOptions;

CmdLineOpt_t rgCmdLineOptions[] = {
{ "--clear-settings", &fClearSettingsOptions, nullptr },
{ "--clear-cache", &fClearCache, nullptr },
{ "--logging", &logging, &loggingOptions },
{ "--fake-mobile", &_fakeMobile, nullptr },
{ "--log-output", &_logOutput, nullptr },
// Add additional command line option flags here
{ "--clear-settings", &fClearSettingsOptions, nullptr },
{ "--clear-cache", &fClearCache, nullptr },
{ "--logging", &logging, &loggingOptions },
{ "--fake-mobile", &_fakeMobile, nullptr },
{ "--log-output", &_logOutput, nullptr },
{ "--release-boot-test", &_runReleaseBuildBootTest, nullptr },
};

ParseCmdLineOptions(argc, argv, rgCmdLineOptions, std::size(rgCmdLineOptions), false);
Expand Down
4 changes: 4 additions & 0 deletions src/QGCApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class QGCApplication : public QApplication
/// Returns true if unit tests are being run
bool runningUnitTests() const { return _runningUnitTests; }

/// Returns true if the application is running a release build boot test
bool runReleaseBuildBootTest() const { return _runReleaseBuildBootTest; }

/// Returns true if Qt debug output should be logged to a file
bool logOutput() const { return _logOutput; }

Expand Down Expand Up @@ -135,6 +138,7 @@ private slots:
void _checkForNewVersion();

bool _runningUnitTests = false; ///< true: running unit tests, false: normal app
bool _runReleaseBuildBootTest = false; ///< true: Run simple boot test to verify release builds aren't hosed in CI
static constexpr int _missingParamsDelayedDisplayTimerTimeout = 1000; ///< Timeout to wait for next missing fact to come in before display
QTimer _missingParamsDelayedDisplayTimer; ///< Timer use to delay missing fact display
QList<QPair<int,QString>> _missingParams; ///< List of missing parameter component id:name
Expand Down
5 changes: 5 additions & 0 deletions src/QmlControls/QGroundControlQmlGlobal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,8 @@ void QGroundControlQmlGlobal::clearDeleteAllSettingsNextBoot()
{
qgcApp()->clearDeleteAllSettingsNextBoot();
}

bool QGroundControlQmlGlobal::runBootTest()
{
return qgcApp()->runReleaseBuildBootTest();
}
2 changes: 2 additions & 0 deletions src/QmlControls/QGroundControlQmlGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class QGroundControlQmlGlobal : public QObject
Q_PROPERTY(QGeoCoordinate flightMapPosition READ flightMapPosition WRITE setFlightMapPosition NOTIFY flightMapPositionChanged)
Q_PROPERTY(double flightMapZoom READ flightMapZoom WRITE setFlightMapZoom NOTIFY flightMapZoomChanged)
Q_PROPERTY(double flightMapInitialZoom MEMBER _flightMapInitialZoom CONSTANT) ///< Zoom level to use when either gcs or vehicle shows up for first time
Q_PROPERTY(bool runBootTest READ runBootTest CONSTANT)

Q_PROPERTY(QString parameterFileExtension READ parameterFileExtension CONSTANT)
Q_PROPERTY(QString missionFileExtension READ missionFileExtension CONSTANT)
Expand Down Expand Up @@ -215,6 +216,7 @@ class QGroundControlQmlGlobal : public QObject
bool singleVehicleSupport ();
bool px4ProFirmwareSupported ();
bool apmFirmwareSupported ();
bool runBootTest ();

void setIsVersionCheckEnabled (bool enable);
void setMavlinkSystemID (int id);
Expand Down
10 changes: 10 additions & 0 deletions src/UI/MainRootWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ ApplicationWindow {

// Start the sequence of first run prompt(s)
firstRunPromptManager.nextPrompt()

if (QGroundControl.runBootTest) {
bootTestTimer.start()
}
}

Timer {
id: bootTestTimer
interval: 1000
onTriggered: mainWindow.finishCloseProcess()
}

QtObject {
Expand Down
Loading