Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into divi/config-server-ci…
Browse files Browse the repository at this point in the history
…-branch
  • Loading branch information
imperfect-fourth committed Oct 19, 2023
2 parents 5bbf361 + 93ef55c commit 15a59aa
Show file tree
Hide file tree
Showing 59 changed files with 3,197 additions and 4,090 deletions.
File renamed without changes.
24 changes: 9 additions & 15 deletions ci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,22 @@ function run {
# Assumes that the given ref is a branch name. Sets a tag for a docker image of
# the form:
#
# dev-main-20230601T1933-bffd555
# --- ---- ------------- -------
# ↑ ↑ ↑ ↑
# prefix "dev" branch | commit hash
# |
# commit date & time (UTC)
# dev-main-bffd555
# --- ---- -------
# ↑ ↑ ↑
# prefix "dev" | commit hash
# branch
#
# Additionally sets a branch tag assuming this is the latest tag for the given
# branch. The branch tag has the form: dev-main
function set_dev_tags {
local branch="$1"
# replace '/' in branch name with '-'
# replace '.' and '/' in branch name with '-'
local tidy_branch
tidy_branch="$(echo "${branch}" | tr "//" -)"
local branch_prefix="dev-$tidy_branch"
tidy_branch="$(tr './' '-' <<< "$branch")"
local branch_prefix="dev-${tidy_branch}"
local version
version=$(
TZ=UTC0 git show \
--quiet \
--date='format-local:%Y%m%dT%H%M' \
--format="$branch_prefix-%cd-%h"
)
version=$(git show --quiet --format="${branch_prefix}-%h")
export docker_tags=("$version" "$branch_prefix")
}

Expand Down
43 changes: 31 additions & 12 deletions crates/connectors/ndc-citus/tests/query_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,6 @@ mod predicates {
insta::assert_json_snapshot!(result);
}

#[tokio::test]
async fn select_where_name_similar() {
let result = run_query(create_router().await, "select_where_name_similar").await;
insta::assert_json_snapshot!(result);
}

#[tokio::test]
async fn select_where_name_nsimilar() {
let result = run_query(create_router().await, "select_where_name_nsimilar").await;
insta::assert_json_snapshot!(result);
}

#[tokio::test]
async fn select_where_name_regex() {
let result = run_query(create_router().await, "select_where_name_regex").await;
Expand Down Expand Up @@ -244,6 +232,37 @@ mod sorting {
.await;
insta::assert_json_snapshot!(result);
}
#[tokio::test]
async fn sorting_by_nested_relationship_column_with_predicate() {
let result = run_query(
create_router().await,
"sorting_by_nested_relationship_column_with_predicate",
)
.await;
insta::assert_json_snapshot!(result);
}

// Citus sorts strings differently than PostgreSQL,
// so the 5th row might be different.
#[tokio::test]
async fn sorting_by_nested_relationship_column_with_predicate_exists() {
let result = run_query(
create_router().await,
"sorting_by_nested_relationship_column_with_predicate_exists",
)
.await;
insta::assert_json_snapshot!(result);
}

#[tokio::test]
async fn sorting_by_relationship_count_with_predicate() {
let result = run_query(
create_router().await,
"sorting_by_relationship_count_with_predicate",
)
.await;
insta::assert_json_snapshot!(result);
}
}

mod aggregation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FROM
FROM
"public"."Album" AS "%0_Album"
WHERE
("%0_Album"."Title" NOT ILIKE cast($1 as varchar))
("%0_Album"."Title" !~~* cast($1 as varchar))
ORDER BY
"%0_Album"."AlbumId" ASC
LIMIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FROM
FROM
"public"."Album" AS "%0_Album"
WHERE
("%0_Album"."Title" LIKE $1)
("%0_Album"."Title" ~~ $1)
ORDER BY
"%0_Album"."AlbumId" ASC
) AS "%2_rows"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
source: crates/connectors/ndc-citus/tests/query_tests.rs
expression: result
---
[
{
"rows": [
{
"Name": "Crazy Train"
},
{
"Name": "I Don't Know"
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
source: crates/connectors/ndc-citus/tests/query_tests.rs
expression: result
---
[
{
"rows": [
{
"Name": "Balls to the Wall"
},
{
"Name": "Fast As a Shark"
},
{
"Name": "Princess of the Dawn"
},
{
"Name": "Restless and Wild"
},
{
"Name": "\"?\""
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
source: crates/connectors/ndc-citus/tests/query_tests.rs
expression: result
---
[
{
"rows": [
{
"Name": "Iron Maiden"
},
{
"Name": "Metallica"
},
{
"Name": "U2"
},
{
"Name": "Led Zeppelin"
},
{
"Name": "Deep Purple"
}
]
}
]
Loading

0 comments on commit 15a59aa

Please sign in to comment.