Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: simonw/datasette
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c6fc1091b0e10fde10878c8db7e949cedfaf136c
Choose a base ref
..
head repository: simonw/datasette
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 36ecb682c5f7a3e731570ecc0552587ce5a0e836
Choose a head ref
Showing with 56 additions and 1 deletion.
  1. +53 −0 .github/workflows/test-sqlite-support.yml
  2. +2 −1 tests/test_api_write.py
  3. +1 −0 tests/test_csv.py
53 changes: 53 additions & 0 deletions .github/workflows/test-sqlite-support.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Test SQLite versions

on: [push, pull_request]

permissions:
contents: read

jobs:
test:
runs-on: ${{ matrix.platform }}
continue-on-error: true
strategy:
matrix:
platform: [ubuntu-latest]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12"]
sqlite-version: [
#"3", # latest version
"3.46",
#"3.45",
#"3.27",
#"3.26",
"3.25",
#"3.25.3", # 2018-09-25, window functions breaks test_upsert for some reason on 3.10, skip for now
#"3.24", # 2018-06-04, added UPSERT support
#"3.23.1" # 2018-04-10, before UPSERT
]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: setup.py
- name: Set up SQLite ${{ matrix.sqlite-version }}
uses: asg017/sqlite-versions@71ea0de37ae739c33e447af91ba71dda8fcf22e6
with:
version: ${{ matrix.sqlite-version }}
cflags: "-DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_JSON1"
- run: python3 -c "import sqlite3; print(sqlite3.sqlite_version)"
- run: echo $LD_LIBRARY_PATH
- name: Build extension for --load-extension test
run: |-
(cd tests && gcc ext.c -fPIC -shared -o ext.so)
- name: Install dependencies
run: |
pip install -e '.[test]'
pip freeze
- name: Run tests
run: |
pytest -n auto -m "not serial"
pytest -m "serial"
3 changes: 2 additions & 1 deletion tests/test_api_write.py
Original file line number Diff line number Diff line change
@@ -537,7 +537,7 @@ async def test_upsert(ds_write, initial, input, expected_rows, should_return):
json=input,
headers=_headers(token),
)
assert response.status_code == 200
assert response.status_code == 200, response.text
assert response.json()["ok"] is True

# Analytics event
@@ -1359,6 +1359,7 @@ async def test_create_table_permissions(


@pytest.mark.asyncio
@pytest.mark.xfail(reason="Flaky, see https://github.com/simonw/datasette/issues/2356")
@pytest.mark.parametrize(
"input,expected_rows_after",
(
1 change: 1 addition & 0 deletions tests/test_csv.py
Original file line number Diff line number Diff line change
@@ -189,6 +189,7 @@ async def test_csv_with_non_ascii_characters(ds_client):
assert response.text == "text,number\r\n𝐜𝐢𝐭𝐢𝐞𝐬,1\r\nbob,2\r\n"


@pytest.mark.xfail(reason="Flaky, see https://github.com/simonw/datasette/issues/2355")
def test_max_csv_mb(app_client_csv_max_mb_one):
# This query deliberately generates a really long string
# should be 100*100*100*2 = roughly 2MB