From 3102e0c06da6a65b15549a101d885c34678f94d3 Mon Sep 17 00:00:00 2001
From: Tue Herlau <tuhe@dtu.dk>
Date: Mon, 19 Sep 2022 17:09:38 +0200
Subject: [PATCH] CI/CD

---
 .gitlab-ci.yml      | 10 ++++++----
 src/slider/slide.py |  3 ++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f837afa..50232ca 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -81,11 +81,12 @@ stages:
     - apt install -y inkscape
     - pip install -U Pillow
     - pip install -e ./
+    - cd tests
 #    - 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
 #    - cd ../02465public/pythontools/tests
-#    - xvfb-run -s "-screen 0 1400x900x24" python test_student_code.py
+    - xvfb-run -s "-screen 0 1400x900x24" python test_slider.py
 
 
 test_39:
@@ -110,9 +111,10 @@ pages:
     - apt install -y python-opengl xvfb # Virtual framebuffer for GL stuff.
     - pwd
     - ls
-#    - mkdir public
-    - cp tests/expected/* public/expected
-    - cp tests/test_images/* public/test_images
+    - cd tests
+    - xvfb-run -s "-screen 0 1400x900x24" python test_slider.py
+    - cp tests/expected public/expected -rf
+    - cp tests/test_images public/test_images -rf
     - cat public/index.html
 #    - apt install -y python3-sphinx
 #    - echo "hello" > public/index.html
diff --git a/src/slider/slide.py b/src/slider/slide.py
index 5715c58..d2ab9bb 100644
--- a/src/slider/slide.py
+++ b/src/slider/slide.py
@@ -187,7 +187,8 @@ def set_svg_background_images(lecture_tex, verbose=False,
         for v in glob.glob(SVG_OSVG_DIR + "/x_do_not_edit*.pdf"):
             # if not v.endswith("png"):
             os.remove(v)
-
+        for f in glob.glob(lecture_tex[:-4] + '_NO_SVGS*'):
+            os.remove(f)
 
         if os.path.exists(DNE):
             for v in glob.glob(DNE + "/*"):
-- 
GitLab