Skip to content

more debugging

more debugging #21

Workflow file for this run

---
# Borrowed heavily from django-snowflake
# https://github.com/Snowflake-Labs/django-snowflake/blob/25c603482b39109509eb2a549672cd9404e5dc6c/.github/workflows/tests.yml
name: Tests
on: [push]
jobs:
django-tests:
runs-on: ubuntu-latest
name: Django Test Suite
steps:
- name: Checkout django-libsql
uses: actions/checkout@v3
- name: Checkout Django
uses: actions/checkout@v3
with:
repository: 'django/django'
ref: '4.2'
path: 'django_repo'
- name: Setup sqld server
run: |
# Databases are handled by host header
echo -e "127.0.0.1 testdb.local\n127.0.0.1 testotherdb.local\n127.0.0.1 db.local\n127.0.0.1 otherdb.local" | sudo tee -a /etc/hosts
# Verify hosts file
cat /etc/hosts
set -x
nslookup testdb.local
nslookup testotherdb.local
nslookup db.local
nslookup otherdb.local
# Start the server
docker run --rm --detach -p 8080:8080 -p 9090:9090 --name sqld -e RUST_LOG=sqld=debug,info ghcr.io/tursodatabase/libsql-server:main /bin/sqld --admin-listen-addr 0.0.0.0:9090 --enable-namespaces
sleep 5
curl testdb.local:8080
curl testotherdb.local:8080
- name: Install system packages for Django's Python test dependencies
run: |
sudo apt-get update
sudo apt-get install libmemcached-dev
- name: Install Django and its Python test dependencies
run: |
pip3 install -U pip
cd django_repo/tests/
pip3 install -e ..
pip3 install -r requirements/py3.txt
- name: install the django-libsql backend
run: pip3 install .
- name: Copy the test settings file
run: cp .github/workflows/libsql_settings.py django_repo/tests/
- name: Run the tests
run: |
export LIBSQL_AUTH_TOKEN=""
export LIBSQL_SYNC_URL=http://db.local:8080
export OTHER_LIBSQL_SYNC_URL=http://otherdb.local:8080
python3 django_repo/tests/runtests.py --settings libsql_settings -v 2
- name: Dump sqld logs and stop
if: always()
run: |
docker logs sqld
docker ps | grep sqld && docker kill sqld