Browse Source

D tests for docker (#3322)

Nate 7 years ago
parent
commit
9f11e23c8b

+ 3 - 3
.travis.yml

@@ -40,9 +40,9 @@ env:
     # - "TESTDIR=Crystal/amber"
     # - "TESTDIR=Crystal/crystal"
     # - "TESTDIR=Crystal/kemal"
-    # - "TESTDIR=D/vibed"
-    # - "TESTDIR=D/hunt"
-    # - "TESTDIR=D/collie"
+     - "TESTDIR=D/vibed"
+     - "TESTDIR=D/hunt"
+     - "TESTDIR=D/collie"
      - "TESTDIR=Dart/dart"
      - "TESTDIR=Dart/redstone"
      - "TESTDIR=Dart/start"

+ 0 - 5
frameworks/D/collie/.gitignore

@@ -1,5 +0,0 @@
- .directory
- .dub
- /collieHttp
- dub.selections.json
-http

+ 0 - 2
frameworks/D/collie/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "collie",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "port": 8085,
@@ -22,7 +21,6 @@
       "versus": "Collie"
   },
     "ldc": {
-      "setup_file": "setup_ldc",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "port": 8085,

+ 8 - 0
frameworks/D/collie/collie-ldc.dockerfile

@@ -0,0 +1,8 @@
+FROM tfb/d-lang:latest
+
+COPY ./ ./
+
+RUN dub upgrade --verbose
+RUN dub build -f -b release --compiler=ldc2
+
+CMD ["./http"]

+ 8 - 0
frameworks/D/collie/collie.dockerfile

@@ -0,0 +1,8 @@
+FROM tfb/d-lang:latest
+
+COPY ./ ./
+
+RUN dub upgrade --verbose
+RUN dub build -f -b release
+
+CMD ["./http"]

+ 0 - 13
frameworks/D/collie/setup.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-fw_depends dlang
-
-# Clean any files from last run
-rm -f http
-rm -rf .dub
-rm -f dub.selections.json
-
-dub upgrade --verbose
-dub build -f -b release
-
-./http &

+ 0 - 13
frameworks/D/collie/setup_ldc.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-fw_depends dlang
-
-# Clean any files from last run
-rm -f http
-rm -rf .dub
-rm -f dub.selections.json
-
-dub upgrade --verbose
-dub build -f -b release --compiler=ldc2
-
-./http &

+ 0 - 1
frameworks/D/hunt/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "hunt",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "plaintext_url": "/plaintext",
       "json_url": "/json",
       "port": 8080,

+ 9 - 0
frameworks/D/hunt/hunt.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/d-lang:latest
+
+COPY ./ ./
+
+RUN dub upgrade --verbose
+
+RUN dub build -f -b release -v
+
+CMD ["./website"]

+ 0 - 2
frameworks/D/hunt/resources/main.html

@@ -1,2 +0,0 @@
-<html>
-</html>

+ 0 - 14
frameworks/D/hunt/setup.sh

@@ -1,14 +0,0 @@
-#!/bin/bash
-
-fw_depends dlang
-
-# Clean any files from last run
-rm -f website
-rm -rf .dub
-rm -f dub.selections.json
-
-dub upgrade --verbose
-
-dub build -f -b release -v
-
-./website

+ 0 - 0
frameworks/D/hunt/source/app/.gitkeeper


+ 0 - 8
frameworks/D/vibed/.gitignore

@@ -1,8 +0,0 @@
-.dub
-docs.json
-__dummy.html
-*.o
-*.obj
-*.dll
-*.exe
-/fwb

+ 0 - 4
frameworks/D/vibed/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "vibed",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",
@@ -26,7 +25,6 @@
       "versus": "vibed"
     },
     "dmd-pgsql": {
-      "setup_file": "setup_pgsql",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",
@@ -50,7 +48,6 @@
       "versus": "vibed"
     },
     "ldc": {
-      "setup_file": "setup_ldc",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",
@@ -74,7 +71,6 @@
       "versus": "vibed"
     },
     "ldc-pgsql": {
-      "setup_file": "setup_ldc_pgsql",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",

+ 0 - 13
frameworks/D/vibed/setup.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-fw_depends mongodb dlang
-
-# Clean any files from last run
-rm -f fwb
-rm -rf .dub
-
-dub upgrade --verbose
-
-dub build -b release --combined
-
-./fwb &

+ 0 - 13
frameworks/D/vibed/setup_ldc.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-fw_depends mongodb dlang
-
-# Clean any files from last run
-rm -f fwb
-rm -rf .dub
-
-dub upgrade --verbose
-
-dub build -b release --compiler=ldc2 --combined --verbose
-
-./fwb &

+ 0 - 13
frameworks/D/vibed/setup_ldc_pgsql.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql dlang
-
-# Clean any files from last run
-rm -f fwb
-rm -rf .dub
-
-dub upgrade --verbose
-
-dub build -b release --compiler=ldc2 --combined --config=postgresql
-
-./fwb &

+ 0 - 13
frameworks/D/vibed/setup_pgsql.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql dlang
-
-# Clean any files from last run
-rm -f fwb
-rm -rf .dub
-
-dub upgrade --verbose
-
-dub build -b release --combined --config=postgresql
-
-./fwb &

+ 10 - 0
frameworks/D/vibed/vibed-dmd-pgsql.dockerfile

@@ -0,0 +1,10 @@
+FROM tfb/d-lang:latest
+
+COPY ./ ./
+
+RUN apt install -yqq libpq-dev zlib1g-dev
+
+RUN dub upgrade --verbose
+RUN dub build -b release --combined --config=postgresql
+
+CMD ["./fwb"]

+ 10 - 0
frameworks/D/vibed/vibed-ldc-pgsql.dockerfile

@@ -0,0 +1,10 @@
+FROM tfb/d-lang:latest
+
+COPY ./ ./
+
+RUN apt install -yqq libpq-dev zlib1g-dev
+
+RUN dub upgrade --verbose
+RUN dub build -b release --compiler=ldc2 --combined --config=postgresql
+
+CMD ["./fwb"]

+ 10 - 0
frameworks/D/vibed/vibed-ldc.dockerfile

@@ -0,0 +1,10 @@
+FROM tfb/d-lang:latest
+
+COPY ./ ./
+
+RUN apt install -yqq zlib1g-dev
+
+RUN dub upgrade --verbose
+RUN dub build -b release --compiler=ldc2 --combined --verbose
+
+CMD ["./fwb"]

+ 8 - 0
frameworks/D/vibed/vibed.dockerfile

@@ -0,0 +1,8 @@
+FROM tfb/d-lang:latest
+
+COPY ./ ./
+
+RUN dub upgrade --verbose
+RUN dub build -b release --combined
+
+CMD ["./fwb"]

+ 29 - 0
toolset/setup/linux/docker/languages/d-lang.dockerfile

@@ -0,0 +1,29 @@
+FROM tfb/base:latest
+
+RUN apt install -yqq xdg-utils
+
+ENV DLANG=/dlang
+ENV DMDVER="2.078.1"
+ENV LDCVER="1.7.0"
+
+RUN mkdir -p $DLANG && \
+    wget http://downloads.dlang.org/releases/2.x/$DMDVER/dmd_$DMDVER-0_amd64.deb && \
+    dpkg-deb -x dmd_$DMDVER-0_amd64.deb $DLANG && \
+    cd $DLANG && \
+    wget https://github.com/ldc-developers/ldc/releases/download/v$LDCVER/ldc2-$LDCVER-linux-x86_64.tar.xz && \
+    tar xvf ldc2-$LDCVER-linux-x86_64.tar.xz && \
+    ln -s $DLANG/ldc2-$LDCVER-linux-x86_64/bin/ldc2 $DLANG/usr/bin/ldc2
+
+# According to this file (dmd.conf) dmd will, upon execution, look for
+# a dmd.conf in 1) the current working directory [bad], 2) the directory
+# specified by the HOME environment variable [bad], 3) the directory in
+# which dmd resides [less bad], and 4) the /etc directory.
+# We are trying to maintain as little global presence as possible, so
+# we need to change the DFLAGS in the dmd.conf to be correctly sandboxed
+# to the $DLANG folder.
+
+RUN cp $DLANG/etc/dmd.conf $DLANG/usr/bin && \
+    sed -i "s|-I/usr/|-I${DLANG}/usr/|g" $DLANG/usr/bin/dmd.conf && \
+    sed -i "s|-L/usr/|-L${DLANG}/usr/|g" $DLANG/usr/bin/dmd.conf
+
+ENV PATH=${DLANG}/usr/bin:${PATH}

+ 0 - 33
toolset/setup/linux/languages/dlang.sh

@@ -1,33 +0,0 @@
-#!/bin/bash
-
-fw_depends xdg-utils
-
-fw_installed dlang && return 0
-
-DLANG=$IROOT/dlang
-DMDVER="2.078.1"
-LDCVER="1.7.0"
-
-mkdir -p $DLANG
-fw_get -O http://downloads.dlang.org/releases/2.x/$DMDVER/dmd_$DMDVER-0_amd64.deb
-dpkg-deb -x dmd_$DMDVER-0_amd64.deb $DLANG
-
-cd $DLANG
-fw_get -O https://github.com/ldc-developers/ldc/releases/download/v$LDCVER/ldc2-$LDCVER-linux-x86_64.tar.xz
-fw_untar ldc2-$LDCVER-linux-x86_64.tar.xz
-ln -s $DLANG/ldc2-$LDCVER-linux-x86_64/bin/ldc2 $DLANG/usr/bin/ldc2
-
-# According to this file (dmd.conf) dmd will, upon execution, look for
-# a dmd.conf in 1) the current working directory [bad], 2) the directory
-# specified by the HOME environment variable [bad], 3) the directory in
-# which dmd resides [less bad], and 4) the /etc directory.
-# We are trying to maintain as little global presence as possible, so
-# we need to change the DFLAGS in the dmd.conf to be correctly sandboxed
-# to the $DLANG folder (in IROOT).
-cp $DLANG/etc/dmd.conf $DLANG/usr/bin
-sed -i "s|-I/usr/|-I${DLANG}/usr/|g" $DLANG/usr/bin/dmd.conf
-sed -i "s|-L/usr/|-L${DLANG}/usr/|g" $DLANG/usr/bin/dmd.conf
-
-echo -e "export PATH=${DLANG}/usr/bin:\$PATH" > $IROOT/dlang.installed
-
-source $IROOT/dlang.installed