Skip to content

Commit 8a88357

Browse files
authored
Merge pull request #60 from michalc/ci/windows-compatibility
ci: Windows compatibility of CI
2 parents ba95828 + ad802fb commit 8a88357

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,16 @@ jobs:
7070
- {os: "ubuntu-20.04", python: "3.10.0"}
7171
- {os: "ubuntu-20.04", python: "3.11.0"}
7272
runs-on: '${{ matrix.os-and-python-version.os }}'
73+
env:
74+
MINIO_ROOT_USER: AKIAIOSFODNN7EXAMPLE
75+
MINIO_ROOT_PASSWORD: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
76+
MINIO_REGION: us-east-1
7377
steps:
7478
- name: "Checkout"
7579
uses: "actions/checkout@v3"
7680
- uses: "actions/setup-python@v4"
7781
with:
7882
python-version: '${{ matrix.os-and-python-version.python }}'
79-
- name: "Run MinIO"
80-
run: |
81-
wget -O minio https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-07-21T21-12-44Z
82-
chmod +x minio
83-
mkdir -p ./data
84-
export MINIO_ROOT_USER=AKIAIOSFODNN7EXAMPLE
85-
export MINIO_ROOT_PASSWORD=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
86-
export MINIO_REGION=us-east-1
87-
./minio server ${PWD}/data &
8883
- uses: actions/download-artifact@v3
8984
with:
9085
name: reporter
@@ -106,6 +101,11 @@ jobs:
106101
pip install ".[dev]"
107102
- name: "Test"
108103
run: |
104+
wget -O minio https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-07-21T21-12-44Z
105+
chmod +x minio
106+
mkdir -p ./data
107+
./minio server ./data &
108+
timeout 22 sh -c 'until nc -z $0 $1; do sleep 1; done' 127.0.0.1 9000
109109
coverage run -m unittest
110110
coverage xml
111111
chmod +x ./reporter/cc-test-reporter

test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -829,16 +829,17 @@ def sign(key, msg):
829829

830830
@contextmanager
831831
def get_db(sqls):
832-
with tempfile.NamedTemporaryFile() as fp:
833-
with sqlite3.connect(fp.name, isolation_level=None) as con:
832+
with tempfile.TemporaryDirectory() as directory_name:
833+
db_path = os.path.join(directory_name, 'sqlite-s3-query-test.db')
834+
with sqlite3.connect(db_path, isolation_level=None) as con:
834835
cur = con.cursor()
835836
cur.execute('BEGIN')
836837
for sql, params in sqls:
837838
cur.execute(sql, params)
838839
cur.execute('COMMIT')
839840

840841
def db():
841-
with open(fp.name, 'rb') as f:
842+
with open(db_path, 'rb') as f:
842843
while True:
843844
chunk = f.read(65536)
844845
if not chunk:

0 commit comments

Comments
 (0)