diff --git a/.gitignore b/.gitignore index c41cc9e35e38efc7d080637859e6c72940b374a2..81462badc514f87a564a4ff3a5c0a3741490c63c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/target \ No newline at end of file +/target +.rocks diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..5fd03e46ffad1bbd546c2045687ce8efacd0461a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,113 @@ +stages: + - test + - lint + - utility + +variables: + GIT_STRATEGY: clone + CI_IMAGE_REPOSITORY: docker-picodata.binary.picodata.io + CI_IMAGE: "${CI_IMAGE_REPOSITORY}/${CI_PROJECT_NAME}:0.1.0" + DOCKER_AUTH_CONFIG: $DOCKER_AUTH_RO + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + +default: + image: $CI_IMAGE + +.rust_cache: &rust_cache + - paths: + - $CI_PROJECT_DIR/.cargo/.crates.toml + - $CI_PROJECT_DIR/.cargo/.crates2.json + - $CI_PROJECT_DIR/.cargo/bin + - $CI_PROJECT_DIR/.cargo/registry/index + - $CI_PROJECT_DIR/.cargo/registry/cache + - $CI_PROJECT_DIR/.cargo/git/db + - $CI_PROJECT_DIR/.cache/sccache + - $CI_PROJECT_DIR/target/debug/libexample.so + key: + files: + - ./Cargo.lock + when: "always" + +.base: + variables: + # variables for rust cache + CARGO_HOME: $CI_PROJECT_DIR/.cargo + SCCACHE_DIR: $CI_PROJECT_DIR/.cache/sccache + RUSTC_WRAPPER: sccache + image: + name: $CI_IMAGE + pull_policy: [always, if-not-present] + tags: + - docker + needs: [] + interruptible: true + cache: + - *rust_cache + +int-test: + stage: "test" + extends: .base + script: + - make int-test + +rust-lint: + extends: .base + stage: lint + script: + - make rust-lint + +rust-fmt: + stage: lint + extends: .base + script: + - cargo fmt --check + +publish-dry-run: + stage: utility + extends: .base + script: + - make publish-dry-run + +publish: + stage: utility + extends: .base + when: manual + script: + - make publish + needs: [publish-dry-run] + +build_ci: + stage: utility + tags: + - shell + inherit: + default: false + variables: + DOCKER_AUTH_CONFIG: $DOCKER_AUTH_RW + + # Image version MUST be passed to CI job, or job will be failed. + CI_IMAGE_VERSION: "" + + # If true is passed here, job will overwrite existing image with the same tag. + # If it is false(default) and image with the same tag already resides in docker registry, job will be failed. + CI_IMAGE_OVERWRITE_TAG: "false" + + # If true is passed here, resulting image would also be tagged as latest. + CI_IMAGE_IS_LATEST: "true" + + BASE_IMAGE_NAME: "${CI_IMAGE_REPOSITORY}/${CI_PROJECT_NAME}" + IMAGE_TAG: "${BASE_IMAGE_NAME}:${CI_IMAGE_VERSION}" + LATEST_IMAGE_TAG: "${BASE_IMAGE_NAME}:latest" + before_script: + - if [ -z "$CI_IMAGE_VERSION" ]; then echo "Image version should be specified, got '$CI_IMAGE_VERSION'" 1>&2 && exit 1; fi + - IMAGE_EXIST=$(docker manifest inspect $IMAGE_TAG > /dev/null; echo $?) + - if [[ "$CI_IMAGE_OVERWRITE_TAG" == "false" && "$IMAGE_EXIST" == "0" ]]; then echo "Image tag already resides in registry and it must not be overwritten" 1>&2 && exit 1; fi + script: + - docker build --file Dockerfile.ci -t $IMAGE_TAG . + - if [ $CI_IMAGE_IS_LATEST = "true" ]; then docker tag $IMAGE_TAG $LATEST_IMAGE_TAG; fi + - docker push --all-tags $BASE_IMAGE_NAME + when: manual + only: + changes: + - Dockerfile.ci + needs: [] diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000000000000000000000000000000000000..81c3a1c71ba8c0aad2d4ee752a80eff0063f9778 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1994 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 2.0.22", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "time 0.1.45", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "clap" +version = "4.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9394150f5b4273a1763355bd1c2ec54cc5a2593f790587bcd6b2c947cfa9211" +dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a78fbdd3cc2914ddf37ba444114bc7765bbdcb55ec9cbe6fa054f0137400717" +dependencies = [ + "anstream", + "anstyle", + "bitflags", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +dependencies = [ + "heck", + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 2.0.22", +] + +[[package]] +name = "clap_lex" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.63", + "quote 1.0.28", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote 1.0.28", + "syn 1.0.109", +] + +[[package]] +name = "dec" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdeb628adfc427c3f926528cf76daf4418453e103151739d48f79b8182cb41f" +dependencies = [ + "decnumber-sys", + "libc", + "static_assertions", +] + +[[package]] +name = "decnumber-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a99b958f19724bc0a2202086d135c2e7ed098e95cdae778546e965648fa47b" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" +dependencies = [ + "cfg-if 0.1.10", + "dirs-sys", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dlopen" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937" +dependencies = [ + "dlopen_derive", + "lazy_static", + "libc", + "winapi", +] + +[[package]] +name = "dlopen_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581" +dependencies = [ + "libc", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "equivalent" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "example" +version = "0.1.0" +dependencies = [ + "anyhow", + "shors", + "tarantool", + "tarantool-test", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "flate2" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 2.0.22", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getopts" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi", + "io-lifetimes", + "rustix 0.37.20", + "windows-sys 0.48.0", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "linkme" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd4ad156b9934dc21cad96fd17278a7cb6f30a5657a9d976cd7b71d6d49c02c" +dependencies = [ + "linkme-impl 0.2.10", +] + +[[package]] +name = "linkme" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97f3302efc6ebb7b5f0810a1096dbbb44a536711a4576bc89264a8f9a1d634d8" +dependencies = [ + "linkme-impl 0.3.10", +] + +[[package]] +name = "linkme-impl" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73fd9dc7072de7168cbdaba9125e8f742cd3a965aa12bde994b4611a174488d8" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 1.0.109", +] + +[[package]] +name = "linkme-impl" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279a77bf40c85a08513aca203635b96610ebf0e37a92cb0cee76e04da100a426" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 2.0.22", +] + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "libc", + "memoffset", +] + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 1.0.109", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "opentelemetry" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "js-sys", + "lazy_static", + "percent-encoding", + "pin-project", + "rand", + "thiserror", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.3.5", + "smallvec", + "windows-targets 0.48.0", +] + +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 2.0.22", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "proc-macro2" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "procfs" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de8dacb0873f77e6aefc6d71e044761fcc68060290f5b1089fcdf84626bb69" +dependencies = [ + "bitflags", + "byteorder", + "hex", + "lazy_static", + "rustix 0.36.14", +] + +[[package]] +name = "prometheus" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +dependencies = [ + "cfg-if 1.0.0", + "fnv", + "lazy_static", + "libc", + "memchr", + "parking_lot", + "procfs", + "protobuf", + "thiserror", +] + +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", +] + +[[package]] +name = "quote" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +dependencies = [ + "proc-macro2 1.0.63", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "refpool" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "369e86b80fa7dc8c561dd9613a5bf25c59d2d3073cd66c47fd9e39802f0ecb58" + +[[package]] +name = "regex" +version = "1.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[package]] +name = "rmp" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3eedffbfcc6a428f230c04baf8f59bd73c1781361e4286111fe900849aaddaf" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rmpv" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de8813b3a2f95c5138fe5925bfb8784175d88d6bff059ba8ce090aa891319754" +dependencies = [ + "num-traits", + "rmp", + "serde", + "serde_bytes", +] + +[[package]] +name = "rust-embed" +version = "6.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73e721f488c353141288f223b599b4ae9303ecf3e62923f40a492f0634a4dc3" +dependencies = [ + "rust-embed-impl", + "rust-embed-utils", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "6.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22ce362f5561923889196595504317a4372b84210e6e335da529a65ea5452b5" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "rust-embed-utils", + "shellexpand", + "syn 2.0.22", + "walkdir", +] + +[[package]] +name = "rust-embed-utils" +version = "7.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512b0ab6853f7e14e3c8754acb43d6f748bb9ced66aa5915a6553ac8213f7731" +dependencies = [ + "sha2", + "walkdir", +] + +[[package]] +name = "rustix" +version = "0.36.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14e4d67015953998ad0eb82887a0eb0129e18a7e2f3b7b0f6c422fddcd503d62" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustix" +version = "0.37.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "serde" +version = "1.0.164" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.164" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 2.0.22", +] + +[[package]] +name = "serde_json" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "452e67b9c20c37fa79df53201dc03839651086ed9bbe92b3ca585ca9fdaa7d85" +dependencies = [ + "indexmap 2.0.0", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "shellexpand" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ccc8076840c4da029af4f87e4e8daeb0fca6b87bbb02e10cb60b791450e11e4" +dependencies = [ + "dirs 4.0.0", +] + +[[package]] +name = "shors" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8586d32940ab0bf6c3ae8bd3d54c890687923b957b2fc0cbba9f6e9eeb3ba2b" +dependencies = [ + "chrono", + "lazy_static", + "log", + "once_cell", + "opentelemetry", + "prometheus", + "rmp-serde", + "rmpv", + "serde", + "serde_json", + "tarantool", + "thiserror", + "utoipa", + "utoipa-gen", + "utoipa-swagger-ui", +] + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "unicode-ident", +] + +[[package]] +name = "tarantool" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1957ea0175d876d0052cf886a751fb96f276e7a1bf4553e42cfde29306ab55eb" +dependencies = [ + "async-trait", + "base64", + "bitflags", + "byteorder", + "dec", + "dlopen", + "futures", + "libc", + "linkme 0.2.10", + "log", + "nix", + "num-derive", + "num-traits", + "once_cell", + "refpool", + "rmp", + "rmp-serde", + "rmpv", + "serde", + "serde_bytes", + "serde_json", + "sha-1", + "tarantool-proc", + "tester", + "thiserror", + "time 0.3.17", + "tlua", + "uuid", + "va_list", +] + +[[package]] +name = "tarantool-proc" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d047ceac7bb814745ed7893d3b6855f4f12e74715ffa5faebc0cff9b6bbf511c" +dependencies = [ + "darling", + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 1.0.109", +] + +[[package]] +name = "tarantool-runner" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b87c5ea878cd7171b51866b299f49f702c6c3c9c0a979968024477001f6f819f" +dependencies = [ + "anyhow", + "clap", + "tempfile", +] + +[[package]] +name = "tarantool-test" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "linkme 0.3.10", + "serde", + "serde_json", + "tarantool", + "tarantool-runner", + "tempfile", + "tester", +] + +[[package]] +name = "tempfile" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "fastrand", + "redox_syscall 0.3.5", + "rustix 0.37.20", + "windows-sys 0.48.0", +] + +[[package]] +name = "term" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0863a3345e70f61d613eab32ee046ccd1bcc5f9105fe402c61fcd0c13eeb8b5" +dependencies = [ + "dirs 2.0.2", + "winapi", +] + +[[package]] +name = "tester" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee72ec31009a42b53de9a6b7d8f462b493ab3b1e4767bda1fcdbb52127f13b6c" +dependencies = [ + "getopts", + "libc", + "term", +] + +[[package]] +name = "tests" +version = "0.1.0" +dependencies = [ + "anyhow", + "example", + "serde", + "serde_json", + "tarantool-runner", + "tarantool-test", + "tempfile", +] + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 2.0.22", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +dependencies = [ + "serde", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "tlua" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f74379fdcb4a174dec814a3071cec3d978f06af5e5681b1f0578475970cc4be5" +dependencies = [ + "libc", + "serde", + "thiserror", + "tlua-derive", +] + +[[package]] +name = "tlua-derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb7956628ae61669b782605fc8ef4fee857c20227ad59548014b7b519b71b251" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 1.0.109", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-ident" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "utoipa" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ae74ef183fae36d650f063ae7bde1cacbe1cd7e72b617cbe1e985551878b98" +dependencies = [ + "indexmap 1.9.3", + "serde", + "serde_json", + "serde_yaml", + "utoipa-gen", +] + +[[package]] +name = "utoipa-gen" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ea8ac818da7e746a63285594cce8a96f5e00ee31994e655bd827569cb8b137b" +dependencies = [ + "proc-macro-error", + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 2.0.22", +] + +[[package]] +name = "utoipa-swagger-ui" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062bba5a3568e126ac72049a63254f4cb1da2eb713db0c1ab2a4c76be191db8c" +dependencies = [ + "mime_guess", + "regex", + "rust-embed", + "serde", + "serde_json", + "utoipa", + "zip", +] + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "va_list" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350bd5ef744f978a387cd08ce514be4e3766746496f355d59d68af36f52d36da" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 2.0.22", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote 1.0.28", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2 1.0.63", + "quote 1.0.28", + "syn 2.0.22", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..3aae7a5ec3f8bea65ae0c076594ba9e9a468d8e8 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,7 @@ +[workspace] + +members = [ + "tarantool-test", + "example", + "tests" +] diff --git a/Dockerfile.ci b/Dockerfile.ci new file mode 100644 index 0000000000000000000000000000000000000000..63ee2941f2996e31560a9c62f2d477f27dae5167 --- /dev/null +++ b/Dockerfile.ci @@ -0,0 +1,19 @@ +FROM docker.binary.picodata.io/rockylinux:8 + +WORKDIR /app + +# install needed packages +RUN dnf install -y epel-release && \ + sed 's/enabled=.*/enabled=1/g' -i /etc/yum.repos.d/epel.repo && \ + dnf install -y --allowerasing git gcc cmake3 libarchive gcc-c++ wget curl \ + findutils unzip bash-completion openssl-devel libicu-devel && \ + rpm --import https://download.picodata.io/tarantool-picodata/el/RPM-GPG-KEY-kdy && \ + dnf install -y https://download.picodata.io/tarantool-picodata/el/8/x86_64/picodata-release-1.1.0.11-1.el8.x86_64.rpm && \ + dnf install -y tarantool-picodata tarantool-picodata-devel && \ + dnf clean all + +# install rust +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.67 -y +ENV PATH="/kafka/bin:/root/.cargo/bin:${PATH}" + +RUN cargo install sccache diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..daaf3d7a2bf0d49951d13cce31a8a7a930759cf5 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +OS := $(shell uname -s) +ifeq ($(OS), Linux) + LIBS_EXT = so +else + ifeq ($(OS), Darwin) + LIBS_EXT = dylib + endif +endif + +build: + cargo build --bin tarantool-test --features="bin" + +build-example: + cargo build -p example + +run-example: build-example + cargo run --features="bin" -p tarantool-test -- -p ./target/debug/libexample.$(LIBS_EXT) + cargo run --features="bin" -p tarantool-test -- -p ./target/debug/libexample.$(LIBS_EXT) -e primary_test_entrypoint + cargo run --features="bin" -p tarantool-test -- -p ./target/debug/libexample.$(LIBS_EXT) -e alternative_test_entrypoint + +int-test: build build-example + cargo test -p tests + +rust-lint: + cargo clippy --all-targets --all-features -- -D warnings + +lint: rust-lint + +publish-dry-run: + cargo publish --dry-run -p tarantool-test --all-features + +publish: + cargo publish -p tarantool-test --all-features diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a4329526feb40830625eeb5881abba8a1f7da109 --- /dev/null +++ b/README.md @@ -0,0 +1,144 @@ +# tarantool-test + +`tarantool-test` is a CLI test framework, written for tarantool-based Rust applications. + +Powered by [tarantool-runner](https://git.picodata.io/picodata/picodata/tarantool-runner), it eliminates huge boilerplate associated with functional tests. + +You have a tarantool-oriented Rust application, and you have tests that depend on tarantool symbols and you find yourself writing your own test suite? Then you've found needed utility. All you need is to write business-logic of your test-suite, bind it through `tarantool-test` macro and use supplied CLI-application. + +Quick glance at CLI usage: + +```bash +# use default entrypoint: +tarantool-test -p ./target/debug/mypackage.so + +# use custom entrypoint(for example, for secondary test suite): +tarantool-test -p ./target/debug/mypackage.so -e custom_entrypoint +``` + +If you want a quick steps to setup tests at your own crate, read [installation](#installation) and [tutorial](#tutorial) sections. + +For more detailed explanation, see [details](#details) and [features](#features) sections. + +## Installation + +`tarantool-test` consists of two parts, merged into one crate: + +1) library, which contains utilities you must use in order to prepare your own crate for tests; +2) binary utility which you install and run just like `cargo test` + +You can install binary utility from `crates.io`: `cargo install --features="bin" tarantool-test`. Take a note that we activated feature `bin` in order to install the binary. **Do not** activate this feature when you use `tarantool-test` as a library. + +You can also install binary utility directly from the repository: + +```bash +git clone https://git.picodata.io/picodata/picodata/tarantool-test +cd tarantool-test +cargo install --features="bin" --path tarantool-test +``` + +In order to add library part to your project, you simply use `tarantool-test` as a dependency: `cargo add tarantool-test` + +## Tutorial + +You can see an example of usage in `Makefile`, target `run-example` executes test suite against `example` crate, which can be found in `example` subdir. + +Now you want to use `tarantool-test` with your own crate. Following steps will use default test suite: + +1. Add `tarantool-test` to your `Cargo.toml` as an ordinary dependency: `cargo add tarantool-test`; +2. Ensure your package could be used by the `tarantool-test`. Include those lines in the `Cargo.toml`: + +```toml +[lib] +crate-type = ["lib", "cdylib"] +``` + +3. Mark desired tests with `#[tarantool_test::test]` attribute macro. This would allow `tarantool-test` to collect and run them; +4. Bind test suite you want to use by using `bind_test_suite` macro - add this line to `lib.rs`: `tarantool_test::bind_test_suite!()` +5. Build your crate: `cargo build -p example`. Check `./target/debug` directory to find out the actual path of shared object you've built. It would be named something like `libexample.so` for Linux or `libexample.dylib` for Macos. +6. Launch your tests by running: `tarantool-test -p ./debug/tarantool/libexample.so`. Tests would be executed, and you are done! No need to cleanup anything. + +If you got confused by some of the points above, check `example` crate or read more details below. + +## Features + +### Multiple test suites + +You are not limited to the single or default test suite - you can use as many custom suites as you want, or even bind same test suite to the many entrypoints. The important thing is that `tarantool-test` binary can only run single entrypoint - so if you would like to run many entrypoints, you'll have to use `tarantool-test` multiple times, at least for now. + +In order to introduce new test suite, you implement `TestSuite` trait for some type. Then you decide which entrypoint you'd like to bind it to, for example `new_test_entrypoint`, and bind test suite to it. Then your setup would look like this: + +```rust +struct MyTestSuite; + +impl tarantool_test::TestSuite for MyTestSuite { + fn before_all() {} + fn after_all() {} + fn before_each() {} + fn after_each() {} +} + +bind_test_suite!(new_test_entrypoint, MyTestSuite); +``` + +Then you run your setup by specifying concrete entrypoint you've used: `tarantool-test -p ./debug/target/myproject.so -e new_test_entrypoint`. + +You can also omit entrypoint name for your custom test suite while binding, then it would be bind to the default entrypoint, which is named "default_test_entrypoint": `bind_test_suite!(MyTestSuite)` + +You can omit test suite type reference, then the default test suite would be bind to the specified entrypoint: `bind_test_suite!(new_test_entrypoint)`. + +Take a note, that default test suite is implemented for `()`, so the line above would have the same effect as this one: `bind_test_suite!(new_test_entrypoint, ())`. + +*NOTE*: You can't use the same entrypoint twice. For example, this setup fails: + +```rust +// DO NOT COMPILE! +bind_test_suite!(first_test_entrypoint); +bind_test_suite!(first_test_entrypoint); +``` + +..But you surely can reuse test suites many times! For example, this setup works: + +```rust +bind_test_suite!(first_test_entrypoint, MyTestSuite); +bind_test_suite!(second_test_entrypoint, MyTestSuite); +``` + +### Override tarantool-runner args + +If you want, you can override some of the arguments that are passed to `tarantool-runner`. Just supply them after `--`. + +For example, you've written your own tarantool initialization script and want `tarantool-test` to use it. You can forward it as an argument to `tarantool-runner` like this: +`tarantool-test -p my_package.so -e my_entrypoint -- -i my_init_script.lua` + +However, there are limitations: you can't override `-p` and `-e` arguments and override input(which goes after `--`). So these usages are **NOT** allowed: + +1. `tarantool-test -p my_package.so -e my_entrypoint -- -e entrypoint` +1. `tarantool-test -p my_package.so -e my_entrypoint -- -p package` +1. `tarantool-test -p my_package.so -e my_entrypoint -- -- "my input"` + +## Details + +### Problem and solution + +**Problem**: `tarantool-module`, which is actively used to develop tarantool applications, depends on tarantool symbols as it is, essentially, a wrapper over tarantool API. Tarantool symbols are supplied only if an application is loaded via tarantool runtime. Therefore, in order to run tests that depend on `tarantool-module`, we have to develop some tarantool runtime and run test suite there. As the number of projects grows, such boilerplate setups migrate from one project to another, keeping bugs and undocumented behavior. + +**Solution**: `tarantool-test` introduces CLI application that runs test suite in the tarantool environment. The only boilerplate you need to write is a few lines of code to setup your test suite(or use the default one if you ain't interested in `before_all` or any other callbacks). + +### Implementation + +`tarantool-test` is backed by [tarantool-runner](https://git.picodata.io/picodata/picodata/tarantool-runner). It executes test setup in the provided by runner tarantool environment, so anything related to `tarantool-runner` is applicable here. +*NOTE*: you don't need to install `tarantool-runner` yourself - it is builtin. + +Currently, `tarantool-test` highly depends on the [tarantool-module](https://git.picodata.io/picodata/picodata/tarantool-module). Namely, `tarantool_test::test` macro is just a reexport of `tarantool::test`, which might change in the future. +Despite the fact that marking tests with `tarantool::test` would also work, it is **discouraged**, as `tarantool_test::test` would someday be separated to include special features. + +What `tarantool-test` does: whenever you use `bind_tarantool_test!` macro, it generates tarantool procedure with needed entrypoint name. Newly created entrypoint deserializes input and launches tests with specified test suite. + +Binary utility simply wraps `tarantool-runner`, introducing cleaner interface. + +## Contributing + +If you have question, problem or suggestion, feel free to reach me directly at `f.telnov@picodata.io` or at [telegram](https://t.me/ftelnov). + +You can also join Picodata chat at [telegram](https://t.me/picodataru) and tag me with your question here as well. We'll be glad to see you there! diff --git a/example/Cargo.toml b/example/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..4192ec65c11f2374a7cf4c5cec5693eb20d2128a --- /dev/null +++ b/example/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "example" +version = "0.1.0" +edition = "2021" + +[dependencies] +tarantool = { version = "1.1.0", features = ["test"] } +tarantool-test = { path = "../tarantool-test" } +anyhow = "1" +shors = "0.4" + +[lib] +crate-type = ["lib", "cdylib"] diff --git a/example/src/lib.rs b/example/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..69b268941b20a69f55b4c4bef484ee34cfe81eb0 --- /dev/null +++ b/example/src/lib.rs @@ -0,0 +1,73 @@ +use std::ffi::c_int; + +use anyhow::Result; +use tarantool::tlua::ffi::lua_State; +use tarantool_test::{bind_test_suite, TestSuite}; + +struct PrimaryTestSuite; + +impl TestSuite for PrimaryTestSuite { + fn before_all() { + println!("primary_before_all") + } + + fn after_all() { + println!("primary_after_all") + } + + fn before_each() { + println!("primary_before_each") + } + + fn after_each() { + println!("primary_after_each") + } +} + +struct AlternativeTestSuite; + +impl TestSuite for AlternativeTestSuite { + fn before_all() { + println!("alt_before_all") + } + + fn after_all() { + println!("alt_after_all") + } + + fn before_each() { + println!("alt_before_each") + } + + fn after_each() { + println!("alt_after_each") + } +} + +#[tarantool_test::test] +fn test_example() { + println!("test example is executed") +} + +#[tarantool_test::test(should_panic)] +fn test_panic_example() { + assert_eq!(1, 0) +} + +// Bind default test suite to default entrypoint. +bind_test_suite!(); + +// you can also bind any test suite to default test entrypoint, like so: +// bind_test_suite!(PrimaryTestSuite); + +// Bind primary test suite to "primary_test_entrypoint" entrypoint. +bind_test_suite!(primary_test_entrypoint, PrimaryTestSuite); + +// Bind alternative test suite to "alternative_test_entrypoint" entrypoint. +bind_test_suite!(alternative_test_entrypoint, AlternativeTestSuite); + +#[allow(clippy::missing_safety_doc)] +#[no_mangle] +pub unsafe extern "C" fn luaopen_libexample(_l: *mut lua_State) -> c_int { + 0 +} diff --git a/tarantool-test/Cargo.toml b/tarantool-test/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..a80e3fd0de330c14b1821edb223b37267619530f --- /dev/null +++ b/tarantool-test/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "tarantool-test" +version = "0.1.0" +edition = "2021" +description = "CLI test framework for tarantool-based Rust applications" +readme = "README.md" +homepage = "https://git.picodata.io/picodata/picodata/tarantool-test" +repository = "https://git.picodata.io/picodata/picodata/tarantool-test" +license = "BSD-2-Clause" +keywords = ["tarantool", "utility", "cli"] +categories = ["command-line-utilities"] +authors = ["Fedor Telnov"] +include = [ + "src/**/*", + "README.md" +] + +[features] +bin = ["dep:clap", "dep:tempfile", "dep:tarantool-runner"] + +[dependencies] +linkme = "0.3" +tarantool = {version = "1.1.0", features = ["test"] } +serde = "1.0" +tester = "0.7" +anyhow = "1" +serde_json = {version = "1"} + +# Binary deps. +clap = {version = "4", features = ["derive"], optional = true} +tempfile = {version = "3", optional = true } +tarantool-runner = { version = "0.1.0", optional = true } + +[[bin]] +name = "tarantool-test" +required-features = ["bin"] \ No newline at end of file diff --git a/tarantool-test/README.md b/tarantool-test/README.md new file mode 120000 index 0000000000000000000000000000000000000000..32d46ee883b58d6a383eed06eb98f33aa6530ded --- /dev/null +++ b/tarantool-test/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/tarantool-test/src/lib.rs b/tarantool-test/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..6ec33fb05782782ab26a593dc5000b149aa59d69 --- /dev/null +++ b/tarantool-test/src/lib.rs @@ -0,0 +1,126 @@ +#![doc = include_str!("../README.md")] +use serde::{Deserialize, Serialize}; +use tarantool::test::test_cases; +use tester::{TestDescAndFn, TestFn, TestOpts}; + +use anyhow::bail; +pub use tarantool::proc as test_entrypoint; +pub use tarantool::test; + +pub const DEFAULT_TEST_ENTRYPOINT_NAME: &str = "default_test_entrypoint"; + +/// Implementors provide custom test suite logic. +pub trait TestSuite { + fn before_all() {} + fn after_all() {} + + fn before_each() {} + fn after_each() {} +} + +// () is the simplest test suite - does nothing in `before_all`, `after_all`, etc. +impl TestSuite for () {} + +#[derive(Clone, Deserialize, Serialize, Debug, Default)] +pub struct TestsConfig { + #[serde(default)] + pub filter: Option<String>, +} + +/// Generates entrypoint function for the test suite. +/// +/// Generated entrypoints are functions that could be used from tarantool runtime - in other words, stored procedures. +#[macro_export] +macro_rules! bind_test_suite { + () => { + bind_test_suite!(@default_entrypoint, ()); + }; + ($suite:ty) => { + bind_test_suite!(@default_entrypoint, $suite); + }; + ($entrypoint:ident) => { + bind_test_suite($entrypoint, ()); + }; + // helper branch that inserts `default_test_entrypoint` as an entrypoint + (@default_entrypoint, $suite:ty) => { + bind_test_suite!(default_test_entrypoint, $suite); + }; + ($entrypoint:ident, $suite:ty) => { + #[$crate::test_entrypoint] + fn $entrypoint(input: String) -> Result<(), Box<dyn std::error::Error>> { + $crate::handle_entrypoint::<$suite>(input)?; + Ok(()) + } + }; +} + +/// Collects tests from the tarantool tester with given suite setup. +pub fn collect_tests<S: TestSuite>(cfg: TestsConfig) -> Vec<TestDescAndFn> { + let tests = test_cases(); + + tests + .iter() + .filter(|case| { + cfg.filter + .as_ref() + .map(|must_contains| case.name().contains(must_contains)) + .unwrap_or(true) + }) + .map(|case| { + let test_fn = move || { + S::before_each(); + case.run(); + S::after_each(); + }; + let mut tester = case.to_tester(); + tester.testfn = TestFn::DynTestFn(Box::new(test_fn)); + tester + }) + .collect() +} + +/// Executes tests with given config and user-provided suite. +pub fn execute_tests<S: TestSuite>(mut cfg: TestsConfig) -> anyhow::Result<()> { + if cfg.filter == Some("".to_string()) { + cfg.filter = None + } + + let opts = &TestOpts { + list: false, + filter: None, + filter_exact: false, + force_run_in_process: false, + exclude_should_panic: false, + run_ignored: tester::RunIgnored::No, + run_tests: true, + bench_benchmarks: false, + logfile: None, + nocapture: false, + color: tester::ColorConfig::AutoColor, + format: tester::OutputFormat::Pretty, + test_threads: Some(1), + skip: vec![], + time_options: None, + options: tester::Options::new(), + }; + + S::before_all(); + let result = tester::run_tests_console(opts, collect_tests::<S>(cfg)); + S::after_all(); + + match result { + Ok(true) => Ok(()), + failure => { + bail!("failed to successfully pass the tests due to failure: {failure:?}"); + } + } +} + +/// Process entrypoint with given input and specific `TestSuite`(given as generic argument). +/// +/// Normally you wouldn't like to call this function yourself - it exists for `bind_test_suite` macro expansion. +pub fn handle_entrypoint<S: TestSuite>(input: String) -> anyhow::Result<()> { + let input: TestsConfig = serde_json::from_str(&input)?; + execute_tests::<S>(input)?; + Ok(()) +} diff --git a/tarantool-test/src/main.rs b/tarantool-test/src/main.rs new file mode 100644 index 0000000000000000000000000000000000000000..5a55301fa3fef5444d3b385e04cb912b71652f71 --- /dev/null +++ b/tarantool-test/src/main.rs @@ -0,0 +1,71 @@ +use anyhow::{Context, Result}; +use clap::Parser; +use tarantool_runner::Cli as RunnerCli; +use tarantool_test::{TestsConfig, DEFAULT_TEST_ENTRYPOINT_NAME}; + +#[derive(Parser)] +#[command(author, version, about, long_about = None)] +struct Cli { + #[arg( + short, + long, + help = r#"Path to the package where tests would be executed. Package must follow the rules established in the `tarantool-runner` utility."# + )] + path: String, + + #[arg( + short, + long, + help = r#"An explicit entrypoint name to use. If not specified, default test entrypoint name is used."# + )] + entrypoint: Option<String>, + + #[arg( + short, + long, + help = "Filter out needed tests by passing their fullname or even part of the name." + )] + filter: Option<String>, + + #[arg( + last = true, + help = r#"An OPTIONAL `tarantool-runner` override parameters. You must not use `-e`, `-p` and input(`--`) here, as they are used internally by tarantool-test."# + )] + runner_overrides: Option<Vec<String>>, +} + +fn process_test_command(args: Cli) -> Result<()> { + let setup_config = TestsConfig { + filter: args.filter, + }; + let serialized_config = serde_json::to_string(&setup_config) + .with_context(|| "failed to serialize test config to json")?; + + let entrypoint = args + .entrypoint + .as_deref() + .unwrap_or(DEFAULT_TEST_ENTRYPOINT_NAME); + + let runner_arguments = ["", "run", "-e", entrypoint, "-p", args.path.as_str()]; + + let runner_overrides = args.runner_overrides.unwrap_or_default(); + let runner_overrides = runner_overrides.iter().map(|params| params.as_str()); + + let runner_input = ["--", &serialized_config]; + + let runner_arguments = runner_arguments + .into_iter() + .chain(runner_overrides) + .chain(runner_input); + + let runner = RunnerCli::try_parse_from(runner_arguments)?; + runner.process_command()?; + + Ok(()) +} + +fn main() -> Result<()> { + let cli = Cli::parse(); + process_test_command(cli)?; + Ok(()) +} diff --git a/tests/Cargo.toml b/tests/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..ec36d7578bcb746ddd1e46e8a3e43dea95e8d625 --- /dev/null +++ b/tests/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "tests" +version = "0.1.0" +edition = "2021" + +[dependencies] +serde = "1.0" +anyhow = "1" + +serde_json = "1" +example = {path = "../example"} +tarantool-test = {path = "../tarantool-test"} +tarantool-runner = { version = "0.1.0" } +tempfile = "3.6" \ No newline at end of file diff --git a/tests/src/lib.rs b/tests/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..0ff2e394d353574a1f2956158125e714c3e720d0 --- /dev/null +++ b/tests/src/lib.rs @@ -0,0 +1,196 @@ +#![cfg(test)] +use std::{ + io::Write, + process::{Command, ExitStatus}, +}; + +use anyhow::Result; +use tarantool_runner::DEFAULT_LUA_INIT; +use tarantool_test::TestsConfig; +use tempfile::NamedTempFile; + +/// Determines package extension of the prepared package. +fn package_extension() -> &'static str { + if cfg!(target_os = "macos") { + "dylib" + } else { + "so" + } +} + +fn example_tests_run(entrypoint: Option<&str>, cfg: TestsConfig) -> Command { + let path_to_package = format!("../target/debug/libexample.{}", package_extension()); + + let mut command = Command::new("../target/debug/tarantool-test"); + + command.arg("-p").arg(path_to_package); + + if let Some(entrypoint) = entrypoint { + command.arg("-e").arg(entrypoint); + } + + if let Some(filter) = cfg.filter { + command.arg("-f").arg(filter); + } + + command +} + +#[allow(unused)] +#[derive(Debug, Clone)] +struct TestCommandResult { + status: ExitStatus, + stdout: String, + stderr: String, +} + +impl TestCommandResult { + fn from_command(command: &mut Command) -> Result<TestCommandResult> { + let output = command.output()?; + Ok(TestCommandResult { + status: command.status()?, + stdout: String::from_utf8(output.stdout)?, + stderr: String::from_utf8(output.stderr)?, + }) + } + + fn assert_status_success(&self, success: bool) { + assert_eq!( + self.status.success(), + success, + "command status invalid: {:?}, command result is: {:?}", + self.status, + self + ) + } + + fn assert_amount_of_passed(&self, amount: usize) { + assert!(self + .stdout + .contains(&format!("test result: ok. {} passed", amount))) + } +} + +const CUSTOM_INIT_MESSAGE: &str = "custom_init_message"; + +fn custom_runner_init_script() -> anyhow::Result<NamedTempFile> { + let init_script = format!("print(\"{CUSTOM_INIT_MESSAGE}\")\n{DEFAULT_LUA_INIT}",); + let mut init_script_file = NamedTempFile::new()?; + init_script_file.write_all(init_script.as_bytes())?; + + Ok(init_script_file) +} + +#[test] +fn it_tests_default_entrypoint() -> Result<()> { + let mut command = example_tests_run(None, Default::default()); + let result = TestCommandResult::from_command(&mut command)?; + result.assert_status_success(true); + result.assert_amount_of_passed(2); + assert!(!result.stdout.contains("before_all")); + + Ok(()) +} + +#[test] +fn it_tests_primary_entrypoint() -> Result<()> { + let mut command = example_tests_run(Some("primary_test_entrypoint"), Default::default()); + let result = TestCommandResult::from_command(&mut command)?; + result.assert_status_success(true); + result.assert_amount_of_passed(2); + + result.stdout.contains("primary_before_all"); + result.stdout.contains("primary_after_all"); + + result.stdout.contains("primary_before_each"); + result.stdout.contains("primary_after_each"); + + Ok(()) +} + +#[test] +fn it_tests_alternative_entrypoint() -> Result<()> { + let mut command = example_tests_run(Some("alternative_test_entrypoint"), Default::default()); + let result = TestCommandResult::from_command(&mut command)?; + result.assert_status_success(true); + result.assert_amount_of_passed(2); + + result.stdout.contains("alt_before_all"); + result.stdout.contains("alt_after_all"); + + result.stdout.contains("alt_before_each"); + result.stdout.contains("alt_after_each"); + + Ok(()) +} + +#[test] +fn it_tests_filter() -> Result<()> { + let mut command = example_tests_run( + None, + TestsConfig { + filter: Some("test_example".into()), + }, + ); + let result = TestCommandResult::from_command(&mut command)?; + result.assert_status_success(true); + result.assert_amount_of_passed(1); + + Ok(()) +} + +#[test] +fn it_tests_with_panicking() -> Result<()> { + let mut command = example_tests_run( + None, + TestsConfig { + filter: Some("test_panic_example".into()), + }, + ); + let result = TestCommandResult::from_command(&mut command)?; + result.assert_status_success(true); + result.assert_amount_of_passed(1); + Ok(()) +} + +#[test] +fn it_tests_with_runner_override() -> Result<()> { + let mut command = example_tests_run(None, Default::default()); + let lua_init = custom_runner_init_script()?; + + command.arg("--").arg("-i").arg(lua_init.path().as_os_str()); + + let result = TestCommandResult::from_command(&mut command)?; + result.assert_status_success(true); + result.assert_amount_of_passed(2); + assert!(result.stdout.contains(CUSTOM_INIT_MESSAGE)); + Ok(()) +} + +#[test] +fn it_tests_with_illegal_runner_override() -> Result<()> { + fn assert_error_handled(mut command: Command) { + let result = TestCommandResult::from_command(&mut command).unwrap(); + result.assert_status_success(false); + assert!(!result.stdout.contains(CUSTOM_INIT_MESSAGE)); + } + + let lua_init = custom_runner_init_script()?; + + let mut command = example_tests_run(None, Default::default()); + command.arg("--").arg("-i").arg(lua_init.path().as_os_str()); + command.arg("-p").arg("package_i_want"); + assert_error_handled(command); + + let mut command = example_tests_run(None, Default::default()); + command.arg("--").arg("-i").arg(lua_init.path().as_os_str()); + command.arg("-i").arg("entrypoint_i_want"); + assert_error_handled(command); + + let mut command = example_tests_run(None, Default::default()); + command.arg("--").arg("-i").arg(lua_init.path().as_os_str()); + command.arg("--").arg("repeated_input_for_some_reason"); + assert_error_handled(command); + + Ok(()) +}