There is a need to automate testing in order to ensure the server works well with anki.
This task is hard.
In terms of sync tests we should have:
- Empty anki syncs to empty server
- Anki with text decks syncs to empty server
- Anki with more text decks sync to partially synced server server (from step 2)
- Anki media decks syncs to empty server
- Same as 3 for media decks
- Anki syncs decks with history that conflict server
In terms of client tested with should have:
- anki desktop
- ankidroid
- anki on IOS (I see no way to automate testing for this one, not a priority for me)
The success conditions are:
- No client error (or specific error if it is the test goal)
- No server error
- All data correctly synced
Please tell me if you see things I have forgotten.
Road to automated testing is long, I think the first steps are:
I managed to run the latest anki desktop in a debian:stable-slim container using the xvfb virtual framebuffer.
Anki is thus running but one cannot access the GUI directly (it would not be useful for testing anyway).
If you have any idea on how to remote control it (using anki repl, qt testing, whatever...), I'm all hears!
Under AGPL3, POC Containerfile for testing:
FROM rust:latest as builder
WORKDIR /usr/src/anki-sync-server-rs
COPY . .
RUN cargo install --path .
FROM debian:stable as test
# Install tool needed to install deps & anki
RUN apt-get update && apt-get install -y aptitude wget bzip2 xvfb && rm -rf /var/lib/apt/lists/*
# Install anki official debian package deps
# See https://askubuntu.com/questions/74478/how-to-install-only-the-dependencies-of-a-package
RUN apt-get update && aptitude search '!~i?reverse-depends("^anki$")' -F "%p" | xargs apt-get install -y && rm -rf /var/lib/apt/lists/*
# Set C.UTF8 local for anki to start
RUN echo 'export LC_CTYPE=C.UTF-8' >> /etc/profile
# Help qt to find xvfb screen
RUN echo 'export QT_QPA_PLATFORM=minimal' >> /etc/profile
COPY --from=builder /usr/local/cargo/bin/ankisyncd /usr/local/bin/ankisyncd
COPY ./tests /usr/tests
CMD ["/usr/tests/run_all"]
There is a need to automate testing in order to ensure the server works well with anki.
This task is hard.
In terms of sync tests we should have:
In terms of client tested with should have:
The success conditions are:
Please tell me if you see things I have forgotten.
Road to automated testing is long, I think the first steps are:
I managed to run the latest anki desktop in a
debian:stable-slimcontainer using thexvfbvirtual framebuffer.Anki is thus running but one cannot access the GUI directly (it would not be useful for testing anyway).
If you have any idea on how to remote control it (using anki repl, qt testing, whatever...), I'm all hears!
Under AGPL3, POC Containerfile for testing: