Skip to content

Commit

Permalink
chore(ci): disable aliyun_drive for bindings test (#4770)
Browse files Browse the repository at this point in the history
* chore(ci): disable aliyun_drive for bindings test

Signed-off-by: suyanhanx <[email protected]>

* try

Signed-off-by: suyanhanx <[email protected]>

* chore: add some comment

Signed-off-by: suyanhanx <[email protected]>

---------

Signed-off-by: suyanhanx <[email protected]>
  • Loading branch information
suyanhanx authored Jun 20, 2024
1 parent b906d8a commit b13a78d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
18 changes: 12 additions & 6 deletions .github/scripts/test_behavior/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Hint:
# Is bin ofs affected?
bin_ofs: bool = field(default=False, init=False)

# Should we run all services test?
# Should we run all services tests?
all_service: bool = field(default=False, init=False)
# affected services set.
services: set = field(default_factory=set, init=False)
Expand All @@ -95,7 +95,7 @@ class Hint:
def calculate_hint(changed_files: list[str]) -> Hint:
hint = Hint()

# Remove all files that ends with `.md`
# Remove all files that end with `.md`
changed_files = [f for f in changed_files if not f.endswith(".md")]

for p in changed_files:
Expand Down Expand Up @@ -179,9 +179,9 @@ def calculate_hint(changed_files: list[str]) -> Hint:
return hint


# unique_cases is used to only one setup for each service.
# `unique_cases` is used to only one setup for each service.
#
# We need this because we have multiple setup for each service and they have already been
# We need this because we have multiple setups for each service, and they have already been
# tested by `core` workflow. So we can only test unique setup for each service for bindings.
#
# We make sure that we return the first setup for each service in alphabet order.
Expand Down Expand Up @@ -221,7 +221,13 @@ def generate_language_binding_cases(
) -> list[dict[str, str]]:
cases = unique_cases(cases)

# Remove hdfs cases for java.
# Disable aliyun_drive case for every language.
#
# This is because aliyun_drive has a speed limit and tests may not be stable enough.
# Bindings may be treated as parallel requests, so we need to disable it for all languages.
cases = [v for v in cases if v["service"] != "aliyun_drive"]

# Remove hdfs cases for jav:a.
if language == "java":
cases = [v for v in cases if v["service"] != "hdfs"]

Expand All @@ -246,7 +252,7 @@ def generate_bin_cases(
# Return empty if this bin is False
if not getattr(hint, f"bin_{bin}"):
return []

cases = unique_cases(cases)

if bin == "ofs":
Expand Down
28 changes: 14 additions & 14 deletions core/src/services/aliyun_drive/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,31 @@ use crate::*;
#[serde(default)]
#[non_exhaustive]
pub struct AliyunDriveConfig {
/// root of this backend.
/// The Root of this backend.
///
/// All operations will happen under this root.
///
/// default to `/` if not set.
/// Default to `/` if not set.
pub root: Option<String>,
/// access_token of this backend.
/// The access_token of this backend.
///
/// Solution for client-only purpose. #4733
///
/// required if no client_id, client_secret and refresh_token are provided.
/// Required if no client_id, client_secret and refresh_token are provided.
pub access_token: Option<String>,
/// client_id of this backend.
/// The client_id of this backend.
///
/// required if no access_token is provided.
/// Required if no access_token is provided.
pub client_id: Option<String>,
/// client_secret of this backend.
/// The client_secret of this backend.
///
/// required if no access_token is provided.
/// Required if no access_token is provided.
pub client_secret: Option<String>,
/// refresh_token of this backend.
/// The refresh_token of this backend.
///
/// required if no access_token is provided.
/// Required if no access_token is provided.
pub refresh_token: Option<String>,
/// drive_type of this backend.
/// The drive_type of this backend.
///
/// All operations will happen under this type of drive.
///
Expand Down Expand Up @@ -106,7 +106,7 @@ impl Debug for AliyunDriveBuilder {
}

impl AliyunDriveBuilder {
/// Set root of this backend.
/// Set the root of this backend.
///
/// All operations will happen under this root.
pub fn root(&mut self, root: &str) -> &mut Self {
Expand Down Expand Up @@ -342,8 +342,8 @@ impl Access for AliyunDriveBackend {
let parent_path = get_parent(to);
let parent_file_id = self.core.ensure_dir_exists(parent_path).await?;

// if from and to are going to be placed in the same folder
// copy_path will fail as we cannot change name during this action.
// if from and to are going to be placed in the same folder,
// copy_path will fail as we cannot change the name during this action.
// it has to be auto renamed.
let auto_rename = file.parent_file_id == parent_file_id;
let res = self
Expand Down
4 changes: 2 additions & 2 deletions core/src/services/aliyun_drive/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ pub enum DriveType {
Default,
/// Use the backup type of Aliyun Drive.
///
/// fallback to the default type if no backup drive found.
/// Fallback to the default type if no backup drive is found.
Backup,
/// Use the resource type of Aliyun Drive.
///
/// fallback to the default type if no resource drive found.
/// Fallback to the default type if no resource drive is found.
Resource,
}

Expand Down

0 comments on commit b13a78d

Please sign in to comment.