diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4896c6f783..d86eaa6c3fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,16 +44,16 @@ jobs: - name: cargo nextest command: cargo nextest run --features=postgres --profile ci --retries 1 cache: true - - name: REST integration tests - command: make rest-test - cache: true + # - name: REST integration tests + # command: make rest-test + # cache: true - name: License headers check command: bash scripts/check_license_headers.sh cache: false - name: rustfmt command: cargo +nightly fmt --all -- --check cache: false - container: public.ecr.aws/l6o9a3f9/quickwit-builder:latest + # container: public.ecr.aws/l6o9a3f9/quickwit-builder:latest services: # PostgreSQL service container postgres: @@ -72,6 +72,8 @@ jobs: --health-retries 5 steps: - uses: actions/checkout@v3 + - name: Install Ubuntu packages + run: sudo apt install protobuf-compiler python3 python3-pip - uses: dorny/paths-filter@v2 id: modified-files with: @@ -88,9 +90,13 @@ jobs: - name: Setup stable Rust Toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: "1.70" override: true components: rustfmt, clippy + - uses: actions-rs/install@v0.1 + with: + crate: cargo-deny + version: latest - name: Setup cache if: matrix.task.cache == true uses: Swatinem/rust-cache@v2 diff --git a/quickwit/Cargo.toml b/quickwit/Cargo.toml index 2818f9bbd1b..7f5ceb0d18a 100644 --- a/quickwit/Cargo.toml +++ b/quickwit/Cargo.toml @@ -1,6 +1,5 @@ [workspace] resolver = "2" -rust-version = "1.70" members = [ "quickwit-actors", "quickwit-aws", diff --git a/quickwit/config/quickwit.yaml b/quickwit/config/quickwit.yaml new file mode 100644 index 00000000000..d814d4db502 --- /dev/null +++ b/quickwit/config/quickwit.yaml @@ -0,0 +1 @@ +version: 0.5 diff --git a/quickwit/rest-api-tests/rest_api_test.py b/quickwit/rest-api-tests/rest_api_test.py index 647df620625..65ee293e395 100755 --- a/quickwit/rest-api-tests/rest_api_test.py +++ b/quickwit/rest-api-tests/rest_api_test.py @@ -140,13 +140,15 @@ def add_path(self, path): path_tree.add_script(path_segs[-1]) def visit_nodes(self, visitor, path=[]): - visitor.enter_directory(path) + success = True + success &= visitor.enter_directory(path) for script in self.scripts: - visitor.run_scenario(path, script) + success &= visitor.run_scenario(path, script) for k in sorted(self.children.keys()): child_path = path + [k] - self.children[k].visit_nodes(visitor, child_path) - visitor.exit_directory(path) + success &= self.children[k].visit_nodes(visitor, child_path) + success &= visitor.exit_directory(path) + return success # Returns a new dictionary without modifying the arguments. # The new dictionary is the result of merging the two dictionaries @@ -164,10 +166,12 @@ def __init__(self, engine): self.context = {} def run_setup_teardown_scripts(self, script_name, path): cwd = "/".join(path) + success = True for file_name in [script_name + ".yaml", script_name + "." + self.engine + ".yaml"]: script_fullpath = cwd + "/" + file_name if osp.exists(script_fullpath): - self.run_scenario(path, file_name) + success &= self.run_scenario(path, file_name) + return success def load_context(self, path): context = {"cwd": "/".join(path)} for file_name in ["_ctx.yaml", "_ctx." + self.engine + ".yaml"]: @@ -180,13 +184,14 @@ def load_context(self, path): def enter_directory(self, path): print("============") self.load_context(path) - self.run_setup_teardown_scripts("_setup", path) + return self.run_setup_teardown_scripts("_setup", path) def exit_directory(self, path): - self.run_setup_teardown_scripts("_teardown", path) + success = self.run_setup_teardown_scripts("_teardown", path) self.context_stack.pop() self.context = {} for ctx in self.context_stack: self.context.update(ctx) + return success def run_scenario(self, path, script): scenario_path = "/".join(path + [script]) steps = list(open_scenario(scenario_path)) @@ -208,9 +213,10 @@ def run_scenario(self, path, script): print(step) print(e) print("--------------") - break + return False else: print("🟢 %s: %d steps (%d skipped)" % (scenario_path, num_steps_executed, num_steps_skipped)) + return True def build_path_tree(paths): paths.sort() @@ -222,7 +228,7 @@ def build_path_tree(paths): def run(scenario_paths, engine): path_tree = build_path_tree(scenario_paths) visitor = Visitor(engine=engine) - path_tree.visit_nodes(visitor) + return path_tree.visit_nodes(visitor) def filter_test(prefixes, test_name): for prefix in prefixes: @@ -250,8 +256,12 @@ def main(): parsed_args = arg_parser.parse_args() scenario_filepaths = glob.glob("scenarii/**/*.yaml", recursive=True) scenario_filepaths = list(filter_tests(parsed_args.test, scenario_filepaths)) - run(scenario_filepaths, engine=parsed_args.engine) + return run(scenario_filepaths, engine=parsed_args.engine) if __name__ == "__main__": - main() + import sys + if main(): + sys.exit(0) + else: + sys.exit(1)