annotate docker/backend-dev-e2e/Dockerfile @ 4037:524856bd7b19

massive refactoring to switch from camelCase to snake_case: historically, Libervia (SàT before) was using camelCase as allowed by PEP8 when using a pre-PEP8 code, to use the same coding style as in Twisted. However, snake_case is more readable and it's better to follow PEP8 best practices, so it has been decided to move on full snake_case. Because Libervia has a huge codebase, this ended with a ugly mix of camelCase and snake_case. To fix that, this patch does a big refactoring by renaming every function and method (including bridge) that are not coming from Twisted or Wokkel, to use fully snake_case. This is a massive change, and may result in some bugs.
author Goffi <goffi@goffi.org>
date Sat, 08 Apr 2023 13:54:42 +0200
parents 09f5ac48ffe3
children 31c84a32c897
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3689
f25442794e11 docker: fix use of `REVISION` in `FROM` instruction
Goffi <goffi@goffi.org>
parents: 3688
diff changeset
1 ARG REVISION
f25442794e11 docker: fix use of `REVISION` in `FROM` instruction
Goffi <goffi@goffi.org>
parents: 3688
diff changeset
2 FROM libervia/backend:${REVISION:-dev}
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
3
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
4 LABEL maintainer="Goffi <tmp_dockerfiles@goffi.org>"
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
5
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6 USER root
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
7
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
8 ARG DEBIAN_FRONTEND=noninteractive
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
9
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
10 RUN mkdir -m 777 /reports && \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
11 apt-get install -y --no-install-recommends \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
12 # firefox is needed to test Libervia via selenium
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
13 firefox-esr \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
14 # VNC/X11 server for visual mode + window manager
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
15 # using openbox as it allows to resize easily when doing manual debugging/tests
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
16 # and it adapts correctly when doing driver.set_window_size
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
17 tigervnc-standalone-server openbox \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
18 # useful for remote debugging
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
19 telnet net-tools \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
20 # needed to make Firefox trust system certificates
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
21 # cf. https://askubuntu.com/a/1036637
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
22 p11-kit && \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
23 ln -fs /usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-trust.so /usr/lib/firefox-esr/libnssckbi.so
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
24
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
25 # we install pre-generated certificates so we can do tests with valid TLS
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
26 COPY --chown=root:root certificates/minica.pem /usr/local/share/ca-certificates/minica.crt
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
27 COPY --chown=root:tls-cert certificates/server1.test/cert.pem /usr/share/libervia/certificates/server1.test.pem
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
28 COPY --chown=root:tls-cert certificates/server1.test/key.pem /usr/share/libervia/certificates/server1.test-key.pem
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
29 RUN update-ca-certificates
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
30
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
31 COPY --chown=root:root libervia.conf /etc/libervia.conf
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
32 COPY --chown=libervia:libervia scripts/entrypoint.sh /home/libervia/entrypoint_e2e.sh
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
33
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
34 RUN \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
35 # we install webdriver (needed to control Firefox from Selenium)
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
36 # note: this is not absolutely necessary as long as we use helium because it includes
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
37 # is own webdriver
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
38 python -c 'from urllib.request import urlretrieve;\
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
39 urlretrieve(\
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
40 "https://github.com/mozilla/geckodriver/releases/download/v0.28.0"\
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
41 "/geckodriver-v0.28.0-linux64.tar.gz", "/usr/local/bin/geckodriver.tar.gz")' && \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
42 cd /usr/local/bin && tar zxf geckodriver.tar.gz && rm -f geckodriver.tar.gz
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
43
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
44 WORKDIR /home/libervia
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
45 USER libervia
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
46
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
47 RUN \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
48 # pytest and its plugins
3671
9c50d2f812c1 docker (e2e): add `pytest-twisted` to image
Goffi <goffi@goffi.org>
parents: 3641
diff changeset
49 pip install pytest pytest-timeout pytest-dependency pytest-twisted \
3641
0ffaa231138c docker: Libervia revision can now be specified:
Goffi <goffi@goffi.org>
parents: 3497
diff changeset
50 # needed to test libervia-cli
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
51 sh \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
52 # needed to test libervia
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
53 helium \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
54 # needed to check sent emails
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
55 aiosmtpd \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
56 # useful for debugging
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
57 pudb
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
58
3385
bcdfe7905409 docker (backend_e2e): install pytest and sh
Goffi <goffi@goffi.org>
parents: 3381
diff changeset
59 RUN ./entrypoint.sh \
bcdfe7905409 docker (backend_e2e): install pytest and sh
Goffi <goffi@goffi.org>
parents: 3381
diff changeset
60 # we create the file sharing component which will autoconnect when backend is started
3688
d5fd630b57bb docker: fix use of File Sharing component following entry point renaming
Goffi <goffi@goffi.org>
parents: 3641
diff changeset
61 li profile create file-sharing -j files.server1.test -p "" --xmpp-password test_e2e -C file-sharing -A && \
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
62 libervia-backend stop
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
63
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
64 ENV LIBERVIA_TEST_REPORT_DIR=/reports
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
65 ENV DISPLAY=:0
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
66 USER root
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
67 RUN apt-get install -y openbox
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
68 USER libervia
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
69 EXPOSE 5900
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
70
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
71 ENTRYPOINT ["/home/libervia/entrypoint_e2e.sh"]