Shared example and test helpers
The helper library used by every runnable example and example test in the workspace. It gathers the shared example utilities (data-file location, resource-key resolution, sample evidence and property formatting) into one small crate so the examples themselves stay focused on the feature they show.
It deliberately keeps a minimal dependency surface, only [fiftyone_pipeline_core] and [fiftyone_pipeline_engines], so it can be shared by Device Detection, IP Intelligence and pipeline examples alike without pulling in either detection facade.
What it provides
- [
find_file] / [find_file_from]. Walk up the directory tree to locate a data or resource file, so it resolves whether an example runs from an IDE, its own crate directory, or a CI checkout.
- [
resource_key_from_env], [license_key_from_env] and [is_invalid_key]. Read a cloud resource key from _51DEGREES_RESOURCE_KEY or the CI-exported names, read a licence key, and screen out obvious placeholders.
- [
cloud_endpoint_from_env]. Read the optional cloud endpoint from _51DEGREES_CLOUD_ENDPOINT, trimmed and screened for blankness, for an on premise web server or a privately hosted 51Degrees cloud (see [CLOUD_ENDPOINT_ENV_VAR]).
- [
dd_data_path] and [ipi_data_path]. Resolve the on-premise Device Detection and IP Intelligence data files, the latter through the ([IpiTier]) Enterprise, ASN and Lite scheme.
- [
find_data_file] / [find_data_file_from]. Find a free data file in the data repository, running the data repository's script to download it when it is missing.
- [
check_data_file] and [data_file_info]. Inspect an on-premise engine's data file and return age and Lite-tier warnings for the example to print.
- [
get_property_as_string]. Render any property from an element data bag to a display string, handling the missing and no-value cases.
- [
missing_properties] and [enterprise_data_file_message]. Name the properties an example asks for that the data file in use does not carry, and give the example's link for asking about the Enterprise data file.
- [
print_find_out_more] and [write_find_out_more]. The "Find out more" section that ends every example's output.
- [
PerformanceResults] and [json_output_path]. The results model the performance examples emit for the nightly performance graphs, and the --json-output argument they take the path from.
- A set of sample evidence values (see the [
evidence] module) covering the common detection paths.