Skip to content

test: API test app#43

Merged
tomasz-blasz merged 4 commits intomainfrom
topic/cpp-test--but-simpler
Feb 27, 2026
Merged

test: API test app#43
tomasz-blasz merged 4 commits intomainfrom
topic/cpp-test--but-simpler

Conversation

@tomasz-blasz
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 25, 2026 16:25
@tomasz-blasz tomasz-blasz marked this pull request as draft February 25, 2026 16:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces a new API test application for testing Firebolt C++ client interfaces. The application provides an interactive command-line tool (or automated mode with --auto flag) to exercise various Firebolt APIs including Accessibility, Advertising, Device, Discovery, Display, Lifecycle, Localization, Network, Presentation, Stats, and TextToSpeech. Additionally, the PR fixes memory leaks in the existing test utilities by properly freeing curl_slist headers.

Changes:

  • Added new api-test-app under test/api-test-app/ with demo classes for 11 Firebolt interfaces
  • Fixed memory leaks in test/utils.cpp by adding curl_slist_free_all() calls
  • Updated CI/CD workflow to build and test the new application with mock-firebolt server

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
test/utils.cpp Fixed memory leaks by properly freeing curl_slist headers after use
test/api-test-app/utils.h Utility functions for console input and configuration management
test/api-test-app/utils.cpp Implementation of console utilities including user input handling
test/api-test-app/main.cpp Main application entry point with argument parsing and interface selection
test/api-test-app/cpp/*.h Header files for demo classes covering 11 Firebolt interfaces
test/api-test-app/cpp/*.cpp Implementation of demo classes with method invocations and event subscriptions
test/api-test-app/build.sh Build script for standalone compilation of the test application
test/api-test-app/CMakeLists.txt CMake configuration for building the api-test-app
src/CMakeLists.txt Removed version properties that were causing issues
build.sh Replaced bash-specific [[ ]] with POSIX-compliant [ ] for portability
CMakeLists.txt Changed demo directory from demo/ to test/api-test-app/
.github/workflows/ci.yml Added api_test_app job to CI workflow, fixed spacing in workflow name
.github/scripts/run-cpp-test.sh New script to run C++ tests with mock-firebolt server
.github/Dockerfile Optimized RUN commands by combining into single layer

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch 3 times, most recently from 3b08298 to fe1d458 Compare February 25, 2026 18:03
@tomasz-blasz tomasz-blasz marked this pull request as ready for review February 25, 2026 18:09
Copilot AI review requested due to automatic review settings February 25, 2026 18:09
@tomasz-blasz tomasz-blasz marked this pull request as draft February 25, 2026 18:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 35 changed files in this pull request and generated 16 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch 3 times, most recently from d537bfc to b2ad80e Compare February 26, 2026 08:33
@tomasz-blasz tomasz-blasz marked this pull request as ready for review February 26, 2026 08:34
Copilot AI review requested due to automatic review settings February 26, 2026 08:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 34 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch from b2ad80e to 42dfa80 Compare February 26, 2026 09:24
Copilot AI review requested due to automatic review settings February 26, 2026 09:25
@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch from 42dfa80 to 56ac177 Compare February 26, 2026 09:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 34 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch 2 times, most recently from 0c9d9c9 to 64e0064 Compare February 26, 2026 10:06
Copilot AI review requested due to automatic review settings February 26, 2026 10:06
@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch from 64e0064 to 10c95bb Compare February 26, 2026 10:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 35 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch from a001ce0 to fa82bab Compare February 26, 2026 10:47
Copilot AI review requested due to automatic review settings February 26, 2026 11:22
@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch from fa82bab to c249c59 Compare February 26, 2026 11:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch 3 times, most recently from 244f4d6 to 4ce672f Compare February 26, 2026 12:44
Copilot AI review requested due to automatic review settings February 26, 2026 13:02
@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch from 4ce672f to 2852e2b Compare February 26, 2026 13:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 48 out of 48 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (3)

.github/scripts/run-api-test-app.sh:100

  • --port is parsed by this script, but the app is always launched with --mock --auto and no URL/port is passed through. Since --mock hardcodes the ws URL in the app, running with a non-default --port won’t change the endpoint. Export FIREBOLT_ENDPOINT=ws://127.0.0.1:$mockPort/ when starting the app (or add a CLI option for URL).
    test/api_test_app/build.sh:56
  • SYSROOT_PATH is interpolated unquoted into the cmake command (-DSYSROOT_PATH=$SYSROOT_PATH), so shell metacharacters in the --sysroot argument or SYSROOT_PATH environment variable (e.g. ;, &&) can break out of the intended command and execute arbitrary shell commands when this script runs. An attacker who can influence SYSROOT_PATH could achieve code execution in the context of the user running build.sh. Quote SYSROOT_PATH (and other path-like variables) in all command invocations so they are passed as single arguments rather than being parsed as shell syntax.
    .github/scripts/run-api-test-app.sh:99
  • The test executable is launched via "./$(basename "$testExe")" --mock --auto, where testExe comes directly from the --test-exe argument. If an attacker can control --test-exe, they can craft a basename containing a double quote and shell metacharacters so that the expanded command closes the surrounding quotes and appends arbitrary commands, leading to code execution when this script runs. Build the command using the full testExe path without embedding it inside an additional quoted string, or otherwise ensure the basename cannot contain characters that alter the shell syntax.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch from 2852e2b to 323b249 Compare February 26, 2026 13:24
Copilot AI review requested due to automatic review settings February 26, 2026 13:59
@tomasz-blasz tomasz-blasz force-pushed the topic/cpp-test--but-simpler branch from 323b249 to ba9f2c4 Compare February 26, 2026 13:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 48 out of 48 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomasz-blasz tomasz-blasz merged commit 106fbf3 into main Feb 27, 2026
22 of 30 checks passed
@tomasz-blasz tomasz-blasz deleted the topic/cpp-test--but-simpler branch February 27, 2026 06:58
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2026
@tomasz-blasz
Copy link
Contributor Author

🎉 This PR is included in version 0.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants