Pārlūkot izejas kodu

Fix test runner and build.

dom111 2 gadi atpakaļ
vecāks
revīzija
762ce47e29
5 mainītis faili ar 47 papildinājumiem un 336 dzēšanām
  1. 0 323
      assets/css/style.css
  2. 28 13
      docker/webdav/Dockerfile
  3. 16 0
      package-lock.json
  4. 1 0
      package.json
  5. 2 0
      tests/lib/isReady.ts

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 323
assets/css/style.css


+ 28 - 13
docker/webdav/Dockerfile

@@ -1,28 +1,48 @@
-FROM httpd:2.4.37-alpine
+FROM httpd:2.4.43-alpine
 
 RUN \
-  apk add --upgrade --update-cache curl && \
+  apk add --upgrade --update-cache curl apr-util && \
   mkdir -p /var/www/html && \
   mkdir -p /var/www/conf && \
 \
   # add images
   for i in 0 1 2 3 4 5 6 7 8 9; do \
-    curl -sL -o "/var/www/html/$i.jpg" "https://picsum.photos/1280/960"; \
+    while ! curl -m 2 -L -o "/var/www/html/$i.jpg" "https://picsum.photos/1280/960"; do \
+      sleep 1; \
+    done \
   done && \
 \
   # add transparent png
-  curl -s -o /var/www/html/transparent-test.png "https://www.w3.org/Graphics/PNG/alphatest.png" && \
+  while ! curl -o /var/www/html/transparent-test.png "https://www.w3.org/Graphics/PNG/alphatest.png"; do \
+    sleep 1; \
+  done && \
 \
   # add fonts
   for font in notoserif/NotoSerif-Regular.ttf unlock/Unlock-Regular.ttf blackandwhitepicture/BlackAndWhitePicture-Regular.ttf indieflower/IndieFlower-Regular.ttf; do \
-    curl -s -o "/var/www/html/$(basename $font)" "https://cdn.jsdelivr.net/gh/google/fonts/ofl/$font"; \
+    while ! curl -m 10 -L -o "/var/www/html/$(basename $font)" "https://cdn.jsdelivr.net/gh/google/fonts/ofl/$font"; do \
+      sleep 1; \
+    done \
   done && \
 \
   # add video
-  curl -s -o /var/www/html/video.mp4 "https://ik.imagekit.io/demo/sample-video.mp4" && \
+  while ! curl -m 10 -L -o /var/www/html/video.mp4 "https://ik.imagekit.io/demo/sample-video.mp4"; do \
+    sleep 1; \
+  done && \
 \
   # add PDF
-  curl -s -o /var/www/html/dummy.pdf "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" && \
+  while ! curl -m 2 -L -o /var/www/html/dummy.pdf "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"; do \
+    sleep 1; \
+  done && \
+\
+  # create som inaccessible files for testing
+  mkdir -p /var/www/html/inaccessible-dir && \
+\
+  while ! curl -m 2 -L -o /var/www/html/inaccessible-image.jpg "https://picsum.photos/1280/960"; do \
+    sleep 1; \
+  done && \
+\
+  echo 'Lorem ipsum dolor sit amet' > /var/www/html/inaccessible-text-file.txt && \
+  > /var/www/html/inaccessible-file && \
 \
   # set up apache
   echo >> /usr/local/apache2/conf/httpd.conf && \
@@ -45,12 +65,7 @@ RUN \
 \
   # set ownership properly
   chown -R daemon:daemon /var/www && \
-\
-  # create som inaccessible files for testing
-  mkdir -p /var/www/html/inaccessible-dir && \
-  curl -sL -o "/var/www/html/inaccessible-image.jpg" "https://picsum.photos/1280/960" && \
-  echo 'Lorem upsum dolor sit amet' > /var/www/html/inaccessible-text-file.txt && \
-  > /var/www/html/inaccessible-file && \
+  chown nobody:nobody /var/www/html/inaccessible* && \
   chmod 700 /var/www/html/inaccessible* && \
 \
   # clean up

+ 16 - 0
package-lock.json

@@ -22,6 +22,7 @@
         "@types/jest": "^27.4.1",
         "@types/jest-environment-puppeteer": "^5.0.1",
         "@types/puppeteer": "^5.4.6",
+        "@xmldom/xmldom": "^0.8.2",
         "esbuild": "^0.14.38",
         "esbuild-sass-plugin": "^2.2.6",
         "jest": "^27.5.1",
@@ -1250,6 +1251,15 @@
         "@types/node": "*"
       }
     },
+    "node_modules/@xmldom/xmldom": {
+      "version": "0.8.2",
+      "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.2.tgz",
+      "integrity": "sha512-+R0juSseERyoPvnBQ/cZih6bpF7IpCXlWbHRoCRzYzqpz6gWHOgf8o4MOEf6KBVuOyqU+gCNLkCWVIJAro8XyQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=10.0.0"
+      }
+    },
     "node_modules/abab": {
       "version": "2.0.6",
       "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz",
@@ -7148,6 +7158,12 @@
         "@types/node": "*"
       }
     },
+    "@xmldom/xmldom": {
+      "version": "0.8.2",
+      "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.2.tgz",
+      "integrity": "sha512-+R0juSseERyoPvnBQ/cZih6bpF7IpCXlWbHRoCRzYzqpz6gWHOgf8o4MOEf6KBVuOyqU+gCNLkCWVIJAro8XyQ==",
+      "dev": true
+    },
     "abab": {
       "version": "2.0.6",
       "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz",

+ 1 - 0
package.json

@@ -34,6 +34,7 @@
     "@types/jest": "^27.4.1",
     "@types/jest-environment-puppeteer": "^5.0.1",
     "@types/puppeteer": "^5.4.6",
+    "@xmldom/xmldom": "^0.8.2",
     "esbuild": "^0.14.38",
     "esbuild-sass-plugin": "^2.2.6",
     "jest": "^27.5.1",

+ 2 - 0
tests/lib/isReady.ts

@@ -49,6 +49,8 @@ export const expectToastShown = async (
 
   const toast = await page.$('.toast__container .toast');
 
+  expect(toast).not.toBeNull();
+
   await expect(
     await toast.evaluate((toast) => toast.childNodes[1].textContent)
   ).toEqual(text);

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels