This commit adds a `--syntax-only` flag for `promtool check config`.
When passing in this flag, promtool will omit various file existence
checks that would cause the check to fail (e.g. the check would not
fail if `rule_files` files don't exist at their respective paths).
This functionality will allow CI systems to check the syntax of
configs without worrying about referenced files.
Fixes: #5222
Signed-off-by: zzehring <zack.zehring@grafana.com>
The promtool check config command still uses the bearer_token_file
field which is deprecated in favour of authorization.credentials_file.
This commit modifies the command to use the new field insted.
Fixes#9874
Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>
* Added feature flag support to unit tests
Signed-off-by: Levi Harrison <git@leviharrison.dev>
* Added/fixed tests
Signed-off-by: Levi Harrison <git@leviharrison.dev>
* Addressed review comments
Signed-off-by: Levi Harrison <git@leviharrison.dev>
* promtool: Calculate mint and maxt per test
Previously a single test that used a later eval time would make all
other tests in the file share the [mint, maxt] and potentially evaluate
far more samples than needed.
Fixes: #8019
Signed-off-by: David Leadbeater <dgl@dgl.cx>