From e008d1a3881a8d984dc80684b836bebe847f7125 Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Sun, 28 Aug 2022 20:45:47 +0800 Subject: [PATCH] debug --- .github/workflows/test.yml | 12 ++++++------ tools/log.py | 8 ++++---- tools/test.zsh | 3 +-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8c0dfd..83552fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,14 +22,14 @@ jobs: pwd export DFS_NO_COMPILE=1 DFS_NO_UPDATE=1 ./install.sh - git checkout $rev + test `git rev-parse HEAD` = "$rev" - name: antigen build shell: /bin/zsh -ileo PIPE_FAIL {0} run: | echo $SHELL antigen list - + - name: run tests shell: /bin/zsh -ileo PIPE_FAIL {0} run: source tools/test.zsh @@ -43,24 +43,24 @@ jobs: brew update brew install git python3 zsh curl sudo pip3 install requests - + - name: checkout repo uses: actions/checkout@v3 - + - name: install dfs run: | rev=`git rev-parse HEAD` pwd export DFS_NO_COMPILE=1 DFS_NO_UPDATE=1 ./install.sh - git checkout $rev + test `git rev-parse HEAD` = "$rev" - name: antigen build shell: /bin/zsh -ileo PIPE_FAIL {0} run: | echo $SHELL antigen list - + - name: run tests shell: /bin/zsh -ileo PIPE_FAIL {0} run: source tools/test.zsh \ No newline at end of file diff --git a/tools/log.py b/tools/log.py index 998661e..82f6a9f 100644 --- a/tools/log.py +++ b/tools/log.py @@ -7,7 +7,7 @@ logging.basicConfig(level=logging.INFO, format="[%(filename)s:%(lineno)d][%(leve try: import requests except ImportError: - logging.fatal("Please install requests module") + logging.critical("Please install requests module") exit(1) @@ -57,17 +57,17 @@ if __name__ == "__main__": content=content.strip() if not content: logging.error("empty log content") - exit(1) + exit(0) resp = post_log(url, hostname, uuid, content) if resp.status_code == 200: logging.info("200 ok") exit(0) elif resp.status_code == 403: - logging.warning("403 forbidden") + logging.error("403 forbidden") logging.info("you may need to register your hostname and uuid") logging.info(f"hostname: {hostname}, uuid: {uuid}") exit(0) else: - logging.error("unknown error ") + logging.critical("unknown error ") logging.error(f"{resp.status_code}: {resp.text}") exit(1) diff --git a/tools/test.zsh b/tools/test.zsh index 3abfda2..e891699 100644 --- a/tools/test.zsh +++ b/tools/test.zsh @@ -24,5 +24,4 @@ alias p114 > /dev/null # check update dfs update dfs version - - +test `git rev-parse HEAD` = `curl -fsSL https://api.beardic.cn/get-var/dfs-commit-id`