Skip to content

Commit

Permalink
Merge pull request #60 from michalc/ci/windows-compatibility
Browse files Browse the repository at this point in the history
ci: Windows compatibility of CI
  • Loading branch information
michalc authored Jul 30, 2023
2 parents ba95828 + ad802fb commit 8a88357
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,16 @@ jobs:
- {os: "ubuntu-20.04", python: "3.10.0"}
- {os: "ubuntu-20.04", python: "3.11.0"}
runs-on: '${{ matrix.os-and-python-version.os }}'
env:
MINIO_ROOT_USER: AKIAIOSFODNN7EXAMPLE
MINIO_ROOT_PASSWORD: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
MINIO_REGION: us-east-1
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
with:
python-version: '${{ matrix.os-and-python-version.python }}'
- name: "Run MinIO"
run: |
wget -O minio https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-07-21T21-12-44Z
chmod +x minio
mkdir -p ./data
export MINIO_ROOT_USER=AKIAIOSFODNN7EXAMPLE
export MINIO_ROOT_PASSWORD=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
export MINIO_REGION=us-east-1
./minio server ${PWD}/data &
- uses: actions/download-artifact@v3
with:
name: reporter
Expand All @@ -106,6 +101,11 @@ jobs:
pip install ".[dev]"
- name: "Test"
run: |
wget -O minio https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-07-21T21-12-44Z
chmod +x minio
mkdir -p ./data
./minio server ./data &
timeout 22 sh -c 'until nc -z $0 $1; do sleep 1; done' 127.0.0.1 9000
coverage run -m unittest
coverage xml
chmod +x ./reporter/cc-test-reporter
Expand Down
7 changes: 4 additions & 3 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,16 +829,17 @@ def sign(key, msg):

@contextmanager
def get_db(sqls):
with tempfile.NamedTemporaryFile() as fp:
with sqlite3.connect(fp.name, isolation_level=None) as con:
with tempfile.TemporaryDirectory() as directory_name:
db_path = os.path.join(directory_name, 'sqlite-s3-query-test.db')
with sqlite3.connect(db_path, isolation_level=None) as con:
cur = con.cursor()
cur.execute('BEGIN')
for sql, params in sqls:
cur.execute(sql, params)
cur.execute('COMMIT')

def db():
with open(fp.name, 'rb') as f:
with open(db_path, 'rb') as f:
while True:
chunk = f.read(65536)
if not chunk:
Expand Down

0 comments on commit 8a88357

Please sign in to comment.