Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Changed
- Updated Firebolt C++ Transport dependency to `v1.1.3`
- In API Test App, URL can be specified on command line: `--url URL`

### Fixed
- Prevented a crash when a mandatory field was missing from the JSON payload
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ params=
buildType="Debug"
cleanFirst=false

while [[ -n "${1:-}" ]]; do
while [[ ! -z $1 ]]; do
case $1 in
--clean) cleanFirst=true;;
--release) buildType="Release";;
Expand Down
17 changes: 10 additions & 7 deletions test/api_test_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,34 @@ The app binary name is:
## Command Line Usage

```bash
api-test-app [--auto] [--mock] [--platform] [--dbg] [--help]
api-test-app [--auto] [--mock] [--platform] [--url <URL>] [--dbg] [--help]
```

### Options

- `--auto`
- `--auto`
Run all methods for all interfaces automatically.

- `--mock`
- `--mock`
Use local mock endpoint: `ws://127.0.0.1:9998/`.

- `--platform`
- `--platform`
Use platform endpoint: `ws://127.0.0.1:3474/`.

- `--dbg`
- `--url URL`
Set the WebSocket endpoint to the specified URL.

- `--dbg`
Enable debug logging.

- `--help`
- `--help`
Print usage and exit.

## Endpoint Selection Priority

The app chooses the WebSocket endpoint in this order:

1. `--mock` or `--platform` (if provided)
1. `--mock` or `--platform` or `--url URL` (if provided)
2. `FIREBOLT_ENDPOINT` environment variable (if set)
3. Default fallback: `ws://127.0.0.1:9998/`

Expand Down
25 changes: 19 additions & 6 deletions test/api_test_app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,32 @@ int main(int argc, char** argv)
{
url = "ws://127.0.0.1:3474/";
}
else if (std::string(argv[i]) == "--url")
{
if (i + 1 >= argc)
{
std::cerr << "Error: --url option requires a URL argument. Use --help to see usage" << std::endl;
return 1;
}
url = argv[++i];
}
else if (std::string(argv[i]) == "--dbg")
{
logLevel = Firebolt::LogLevel::Debug;
}
else if (std::string(argv[i]) == "--help")
{
/* clang-format off */
std::cout << "Usage: " << argv[0] << " [--auto] [--mock] [--platform] [--dbg] [--help]" << std::endl;
std::cout << " --auto Automatically run all methods for all interfaces without user input." << std::endl;
std::cout << " --mock Connect to a local mock server instead of the default Firebolt Demo Service." << std::endl;
std::cout << " --platform Connect to the platform's Firebolt service (default if available)." << std::endl;
std::cout << " --dbg Enable debug logging." << std::endl;
std::cout << " --help Show this help message." << std::endl;
std::cout << "SYNOPSIS" << std::endl;
std::cout << " " << argv[0] << " [<options>]" << std::endl;
std::cout << std::endl;
std::cout << "OPTIONS" << std::endl;
std::cout << " --auto Automatically run all methods for all interfaces without user input" << std::endl;
std::cout << " --mock Connect to a local mock server instead of the default Firebolt Demo Service" << std::endl;
std::cout << " --platform Connect to the platform's Firebolt service (default if available)" << std::endl;
std::cout << " --url <URL> Specify a custom URL for the Firebolt service" << std::endl;
std::cout << " --dbg Enable debug logging" << std::endl;
std::cout << " --help Show this help message" << std::endl;
/* clang-format on */
return 0;
}
Expand Down