diff --git a/.github/workflows/mvp-ci.yml b/.github/workflows/mvp-ci.yml new file mode 100644 index 000000000..e3950f5b0 --- /dev/null +++ b/.github/workflows/mvp-ci.yml @@ -0,0 +1,75 @@ +name: MVP CI + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +concurrency: + group: mvp-ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + backend: + name: MVP backend + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Checkout ASAPQuery-backend + uses: actions/checkout@v4 + with: + path: ASAPQuery-backend + + - name: Checkout ASAPCollector dependency + uses: actions/checkout@v4 + with: + repository: ProjectASAP/ASAPCollector + path: ASAPCollector + token: ${{ secrets.ASAP_CI_REPO_TOKEN }} + + - name: Checkout asap_sketchlib dependency + uses: actions/checkout@v4 + with: + repository: ProjectASAP/asap_sketchlib + path: asap_sketchlib + + - name: Install Rust components + run: rustup component add rustfmt clippy + + - name: Install protobuf compiler + run: sudo apt-get update && sudo apt-get install --yes protobuf-compiler + + - name: Configure private Cargo dependencies + env: + ASAP_CI_REPO_TOKEN: ${{ secrets.ASAP_CI_REPO_TOKEN }} + run: git config --global url."https://x-access-token:${ASAP_CI_REPO_TOKEN}@github.com/".insteadOf "https://github.com/" + + - name: Cache Rust build + uses: Swatinem/rust-cache@v2 + with: + workspaces: ASAPQuery-backend + + - name: Check formatting + working-directory: ASAPQuery-backend + run: cargo fmt -p control_plane -p data_plane -- --check + + - name: Check control plane and data plane + env: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + working-directory: ASAPQuery-backend + run: cargo check -p control_plane -p data_plane + + - name: Lint control plane and data plane + env: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + working-directory: ASAPQuery-backend + run: cargo clippy -p control_plane -p data_plane --all-targets + + - name: Test MVP control plane + env: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + working-directory: ASAPQuery-backend + run: cargo test -p control_plane diff --git a/data_plane/src/query_engines/thanos_query_engine/forward.rs b/data_plane/src/query_engines/thanos_query_engine/forward.rs index e33da377e..d84661714 100644 --- a/data_plane/src/query_engines/thanos_query_engine/forward.rs +++ b/data_plane/src/query_engines/thanos_query_engine/forward.rs @@ -1050,7 +1050,7 @@ mod tests { #[test] fn parse_vector_extracts_value_and_timestamp() { let raw: Value = serde_json::from_str( - r#"[{"metric":{"__name__":"x","job":"a"},"value":[1700000000.5,"3.14"]}]"#, + r#"[{"metric":{"__name__":"x","job":"a"},"value":[1700000000.5,"3.125"]}]"#, ) .unwrap(); let arr = raw.as_array().unwrap().clone(); @@ -1058,7 +1058,7 @@ mod tests { match result { QueryResult::Vector(iv) => { assert_eq!(iv.values.len(), 1); - assert!((iv.values[0].value - 3.14).abs() < 1e-9); + assert!((iv.values[0].value - 3.125).abs() < 1e-9); assert_eq!(iv.timestamp, 1_700_000_000_500); } other => panic!("expected Vector, got {other:?}"),