Ability to run the OPA testsuite (#39)

`OPA_TESTS_DIR=path/to/testsuite cargo test opa -- --shot-output` to run opa tests.
Failing test cases are saved in target/opa/folder for investigation.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2023-11-09 15:11:33 -08:00
committed by GitHub
parent d69b413c8e
commit 0af8b6ea12
9 changed files with 186 additions and 193 deletions
-19
View File
@@ -4,7 +4,6 @@
use anyhow::{anyhow, bail, Result};
use regorus::*;
use serde::{Deserialize, Serialize};
use std::env;
use test_generator::test_resources;
macro_rules! my_assert_eq {
@@ -700,24 +699,6 @@ fn yaml_test(file: &str) -> Result<()> {
}
}
#[test]
#[ignore = "intended for use by scripts/yaml-test-parse"]
fn one_yaml() -> Result<()> {
let mut file = String::default();
for a in env::args() {
if a.ends_with(".yaml") {
file = a;
break;
}
}
if file.is_empty() {
bail!("missing yaml test file");
}
yaml_test(file.as_str())
}
#[test_resources("tests/parser/**/*.yaml")]
fn run(path: &str) {
yaml_test(path).unwrap()