Skip to content
Snippets Groups Projects
Commit 356157b3 authored by tuhe's avatar tuhe
Browse files

CI/CD

parent 3523dd19
No related branches found
No related tags found
No related merge requests found
Pipeline #7446 failed
......@@ -72,7 +72,12 @@ stages:
- apt install git
- apt install -y xvfb # Virtual framebuffer for GL stuff.
- pwd
- ls
- add-apt-repository universe
- add-apt-repository ppa:inkscape.dev/stable
- apt-get update
- apt install -y inkscape
- pip install -y Pillow
- pip install -e ./
# - apt install -y swig # build-essential python-dev swig python-pygame # This is for swig. Remove when you go to a conda build system (and see what happens).
# - pip install -U -r ../02465students/requirements_pip.txt --no-cache --upgrade
# - pip install -U -r ../02465students/requirements_conda.txt --no-cache --upgrade
......
<html><body>
<h1>Stuff here</h1>
</body></html>
\ No newline at end of file
......@@ -8,3 +8,5 @@ matplotlib
pylatexenc
beautifulsoup4
PyPDF2
# These requirements are for the test system.
Pillow
\ No newline at end of file
tests/expected/index_a.png

15.4 KiB

tests/expected/index_b.png

14.6 KiB

tests/expected/index_front.png

56.1 KiB

import os.path
import shutil
from slider.convert import pdf2png
if __name__ == "__main__":
from test_slider import TestSlider
TestSlider.setUpClass()
if not os.path.isdir("expected"):
os.makedirs("expected")
shutil.move("automatic/index_a.png", "expected/index_a.png")
pdf2png("automatic/index.pdf", fout="expected/index_front.png", page_to_convert=1)
shutil.move("automatic/index_b.png", "expected/index_b.png")
TestSlider.tearDownClass()
a = 234
\ No newline at end of file
tests/test_images/index_a.png

15.4 KiB

tests/test_images/index_b.png

14.6 KiB

tests/test_images/index_front.png

56.1 KiB

......@@ -8,6 +8,9 @@ import os
import subprocess
from slider.convert import pdf2png
from slider.slider_cli import slider_cli
# import sys
# sys.path.append(os.path.dirname(os.path.abspath(__file__)) +"/../src")
def assert_images_equal(image_1: str, image_2: str):
img1 = Image.open(image_1)
......@@ -28,16 +31,22 @@ def assert_images_equal(image_1: str, image_2: str):
class TestSlider(TestCase):
@classmethod
def tearDownClass(cls) -> None:
if os.path.isdir("./automatic"):
shutil.rmtree("./automatic")
@classmethod
def setUpClass(cls) -> None:
# Generate the output files.
if os.path.isdir("./automatic"):
shutil.rmtree("./automatic")
os.mkdir("automatic")
if os.path.isdir("./test_images"):
shutil.rmtree("./test_images")
os.mkdir("./test_images")
slider_cli("automatic/index.tex", interactive=False)
fn = "automatic/osvgs/myoverlay.svg"
......@@ -58,20 +67,18 @@ class TestSlider(TestCase):
with open(fn, 'w') as f:
f.write(ss)
slider_cli("automatic/index.tex", interactive=False)
pdf2png("automatic/index.pdf", fout="automatic/index_b.png", page_to_convert=2)
a = 234
pass
def test_frontpage(self):
pass
shutil.copyfile("automatic/index_a.png", "test_images/index_a.png")
shutil.copyfile("automatic/index_b.png", "test_images/index_b.png")
pdf2png("automatic/index.pdf", fout="test_images/index_front.png", page_to_convert=1)
shutil.copyfile("automatic/index.pdf", "test_images/index.pdf")
def test_second_page_before_compile(self):
pass
assert_images_equal("automatic/index_a.png", "expected/index_a.png")
def test_second_page_after_compile(self):
pass
assert_images_equal("automatic/index_b.png", "expected/index_b.png")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment