-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prefix dataset alias with account name
- Loading branch information
Showing
10 changed files
with
233 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/e2e/app/cli/inmem/tests/tests/rest_api/test_gql_query.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright Kamu Data, Inc. and contributors. All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. | ||
|
||
use kamu_cli_e2e_common::prelude::*; | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
kamu_cli_run_api_server_e2e_test!( | ||
storage = inmem, | ||
fixture = | ||
kamu_cli_e2e_repo_tests::rest_api::test_gql_query_mut_create_empty_returns_correct_alias_mt, | ||
options = Options::default().with_multi_tenant() | ||
); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
kamu_cli_run_api_server_e2e_test!( | ||
storage = inmem, | ||
fixture = | ||
kamu_cli_e2e_repo_tests::rest_api::test_gql_query_mut_create_empty_returns_correct_alias_st | ||
); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/e2e/app/cli/postgres/tests/tests/rest_api/test_gql_query.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright Kamu Data, Inc. and contributors. All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. | ||
|
||
use kamu_cli_e2e_common::prelude::*; | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
kamu_cli_run_api_server_e2e_test!( | ||
storage = postgres, | ||
fixture = | ||
kamu_cli_e2e_repo_tests::rest_api::test_gql_query_mut_create_empty_returns_correct_alias_mt, | ||
options = Options::default().with_multi_tenant() | ||
); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
kamu_cli_run_api_server_e2e_test!( | ||
storage = postgres, | ||
fixture = | ||
kamu_cli_e2e_repo_tests::rest_api::test_gql_query_mut_create_empty_returns_correct_alias_st | ||
); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
src/e2e/app/cli/repo-tests/src/rest_api/test_gql_query.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
// Copyright Kamu Data, Inc. and contributors. All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. | ||
|
||
use kamu_cli_e2e_common::{KamuApiServerClient, KamuApiServerClientExt}; | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
pub async fn test_gql_query_mut_create_empty_returns_correct_alias_mt( | ||
mut kamu_api_server_client: KamuApiServerClient, | ||
) { | ||
let token = kamu_api_server_client.auth().login_as_e2e_user().await; | ||
kamu_api_server_client.set_token(Some(token)); | ||
|
||
kamu_api_server_client | ||
.graphql_api_call_assert( | ||
indoc::indoc!( | ||
r#" | ||
mutation { | ||
datasets { | ||
createEmpty(datasetKind: ROOT, datasetAlias: "empty-root-dataset") { | ||
message | ||
... on CreateDatasetResultSuccess { | ||
dataset { | ||
alias | ||
owner { | ||
accountName | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
"#, | ||
), | ||
Ok(indoc::indoc!( | ||
r#" | ||
{ | ||
"datasets": { | ||
"createEmpty": { | ||
"dataset": { | ||
"alias": "e2e-user/empty-root-dataset", | ||
"owner": { | ||
"accountName": "e2e-user" | ||
} | ||
}, | ||
"message": "Success" | ||
} | ||
} | ||
} | ||
"#, | ||
)), | ||
) | ||
.await; | ||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
pub async fn test_gql_query_mut_create_empty_returns_correct_alias_st( | ||
mut kamu_api_server_client: KamuApiServerClient, | ||
) { | ||
let login_response = kamu_api_server_client | ||
.graphql_api_call(indoc::indoc!( | ||
r#" | ||
mutation { | ||
auth { | ||
login(loginMethod: "password", loginCredentialsJson: "{\"login\":\"kamu\",\"password\":\"kamu\"}") { | ||
accessToken, | ||
account { | ||
id | ||
} | ||
} | ||
} | ||
} | ||
"#, | ||
)) | ||
.await; | ||
let token = login_response["auth"]["login"]["accessToken"] | ||
.as_str() | ||
.map(ToOwned::to_owned) | ||
.unwrap(); | ||
kamu_api_server_client.set_token(Some(token)); | ||
|
||
kamu_api_server_client | ||
.graphql_api_call_assert( | ||
indoc::indoc!( | ||
r#" | ||
mutation { | ||
datasets { | ||
createEmpty(datasetKind: ROOT, datasetAlias: "empty-root-dataset") { | ||
message | ||
... on CreateDatasetResultSuccess { | ||
dataset { | ||
alias | ||
owner { | ||
accountName | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
"#, | ||
), | ||
Ok(indoc::indoc!( | ||
r#" | ||
{ | ||
"datasets": { | ||
"createEmpty": { | ||
"dataset": { | ||
"alias": "empty-root-dataset", | ||
"owner": { | ||
"accountName": "kamu" | ||
} | ||
}, | ||
"message": "Success" | ||
} | ||
} | ||
} | ||
"#, | ||
)), | ||
) | ||
.await; | ||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/e2e/app/cli/sqlite/tests/tests/rest_api/test_gql_query.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright Kamu Data, Inc. and contributors. All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. | ||
|
||
use kamu_cli_e2e_common::prelude::*; | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
kamu_cli_run_api_server_e2e_test!( | ||
storage = sqlite, | ||
fixture = | ||
kamu_cli_e2e_repo_tests::rest_api::test_gql_query_mut_create_empty_returns_correct_alias_mt, | ||
options = Options::default().with_multi_tenant() | ||
); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
kamu_cli_run_api_server_e2e_test!( | ||
storage = sqlite, | ||
fixture = | ||
kamu_cli_e2e_repo_tests::rest_api::test_gql_query_mut_create_empty_returns_correct_alias_st | ||
); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters