Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f4fa8f

Browse files
test(ci): create a dummy ~/.python-gitlab.cfg file
Create a working ~/.python-gitlab.cfg file when running the unit testsin the CI. This is to ensure our unit tests still work if a configfile exists.
1 parent8ba97aa commit0f4fa8f

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

‎.github/workflows/test.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
python-version:${{ matrix.python.version }}
5353
-name:Install dependencies
5454
run:pip3 install tox pytest-github-actions-annotate-failures
55+
-name:Setup dummy config
56+
run:tests/ci_tools/setup-dummy-config.sh
5557
-name:Run tests
5658
env:
5759
TOXENV:${{ matrix.python.toxenv }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
set -u
4+
5+
if [[-z"${CI:-}"||-z"${GITHUB_ACTIONS:-}" ]];then
6+
echo"ERROR: Not running in the GitHub CI."
7+
exit 2
8+
fi
9+
10+
CONFIG_FILE=~/.python-gitlab.cfg
11+
if [[-e"${CONFIG_FILE}" ]];then
12+
echo"ERROR: Config file already exists:${CONFIG_FILE}"
13+
echo"Saved you from destroying your config"
14+
exit 2
15+
fi
16+
17+
cat<<EOF >"${CONFIG_FILE}"
18+
[global]
19+
default = gitlab
20+
ssl_verify = true
21+
timeout = 5
22+
api_version = 4
23+
24+
[gitlab]
25+
url = https://gitlab.com/
26+
private_token = not-a-valid-token
27+
EOF
28+
29+
echo"Setup config at:${CONFIG_FILE}"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp