Skip to content

Commit

Permalink
CI: add --log-level for commands. (#4836)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 authored May 10, 2024
1 parent 308dc87 commit c59e724
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/scripts/hypo/command_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def parse_info(self, info: str):
def do_info(self, entry, strict=True, user='root', raw=True, recuisive=False):
abs_path = os.path.join(self.root_dir, entry)
try:
cmd = f'sudo -u {user} ./juicefs info {abs_path}'
cmd = f'sudo -u {user} ./juicefs info --log-level error {abs_path}'
if raw:
cmd += ' --raw'
if recuisive:
Expand All @@ -140,7 +140,7 @@ def do_info(self, entry, strict=True, user='root', raw=True, recuisive=False):
def do_rmr(self, entry, user='root'):
abspath = os.path.join(self.root_dir, entry)
try:
result = self.run_cmd(f'sudo -u {user} ./juicefs rmr {abspath}')
result = self.run_cmd(f'sudo -u {user} ./juicefs rmr --log-level error {abspath}')
if '<ERROR>:' in result:
return self.handleException(Exception(result), 'do_rmr', abspath)
except subprocess.CalledProcessError as e:
Expand Down Expand Up @@ -175,7 +175,7 @@ def do_dump(self, folder, fast=False, skip_trash=False, threads=1, keep_secret_k
return self.clean_dump(result)

def get_dump_cmd(self, meta_url, subdir, fast, skip_trash, keep_secret_key, threads, user='root'):
cmd = f'sudo -u {user} ./juicefs dump {meta_url} '
cmd = f'sudo -u {user} ./juicefs dump --log-level error {meta_url} '
cmd += f' --subdir /{subdir}' if subdir != '' else ''
cmd += f' --fast' if fast else ''
cmd += f' --skip-trash' if skip_trash else ''
Expand Down Expand Up @@ -227,7 +227,7 @@ def clean_dump(self, dump):
def do_warmup(self, entry, user='root'):
abspath = os.path.join(self.root_dir, entry)
try:
self.run_cmd(f'sudo -u {user} ./juicefs warmup {abspath}')
self.run_cmd(f'sudo -u {user} ./juicefs warmup --log-level error {abspath}')
except subprocess.CalledProcessError as e:
return self.handleException(e, 'do_warmup', abspath)
self.stats.success('do_warmup')
Expand All @@ -236,7 +236,7 @@ def do_warmup(self, entry, user='root'):

def do_gc(self, compact:bool, delete:bool, user:str='root'):
try:
cmd = f'sudo -u {user} ./juicefs gc {self.meta_url}'
cmd = f'sudo -u {user} ./juicefs gc --log-level error {self.meta_url}'
if compact:
cmd += ' --compact'
if delete:
Expand All @@ -252,7 +252,7 @@ def do_clone(self, entry, parent, new_entry_name, preserve:bool, user:str='root'
abspath = os.path.join(self.root_dir, entry)
dest_abspath = os.path.join(self.root_dir, parent, new_entry_name)
try:
cmd = f'sudo -u {user} ./juicefs clone {abspath} {dest_abspath}'
cmd = f'sudo -u {user} ./juicefs clone --log-level error {abspath} {dest_abspath}'
if preserve:
cmd += ' --preserve'
self.run_cmd(cmd)
Expand All @@ -265,7 +265,7 @@ def do_clone(self, entry, parent, new_entry_name, preserve:bool, user:str='root'
def do_fsck(self, entry, repair=False, recuisive=False, user='root'):
abspath = os.path.join(self.root_dir, entry)
try:
cmd = f'sudo -u {user} ./juicefs fsck {self.meta_url} --path {abspath}'
cmd = f'sudo -u {user} ./juicefs fsck --log-level error {self.meta_url} --path {abspath}'
if repair:
cmd += ' --repair'
if recuisive:
Expand Down Expand Up @@ -327,7 +327,7 @@ def do_trash_restore(self, index, user='root'):
def do_compact(self, entry, threads, user):
path = os.path.join(self.root_dir, entry)
try:
self.run_cmd(f'sudo -u {user} ./juicefs compact {path} --threads {threads}')
self.run_cmd(f'sudo -u {user} ./juicefs compact --log-level error {path} --threads {threads}')
except subprocess.CalledProcessError as e:
return self.handleException(e, 'do_compact', path, user=user)
self.stats.success('do_compact')
Expand Down

0 comments on commit c59e724

Please sign in to comment.