Browse Source

Added M-Web-Server tests (Mumps) (#5971)

* Added M-Web-Server tests (Mumps)

* Update .travis.yml
Sumeet Chhetri 5 years ago
parent
commit
c2a4a30c5e

+ 1 - 0
.travis.yml

@@ -60,6 +60,7 @@ env:
     - "TESTLANG=Kotlin"
     - "TESTLANG=Lisp"
     - "TESTLANG=Lua"
+    - "TESTLANG=Mumps"
     - "TESTLANG=Nim"
     - 'TESTDIR="Nim/httpbeast Nim/jester Nim/basolato"'
     - "TESTLANG=Perl"

+ 22 - 0
frameworks/Mumps/m-web-server/_techempbenchmark.m

@@ -0,0 +1,22 @@
+%techempbenchmark ; Techempower plaintext and json tests;2020-08-31 09:30PM
+ ;
+
+te
+ S ^%webhttp(0,"NOGZIP")=1
+ D job^%webreq(8080,"",,,1)
+ ;D start^%webreq(8080,"",,,,,1)
+ Q
+
+plaintext(RESULT,ARGS) ; [Public] GET /plaintext
+ S RESULT("mime")="text/plain"
+ S RESULT="Hello, World!"
+ Q
+
+json(RESULT,ARGS) ; [Public] GET /json
+ S RESULT("mime")="application/json"
+ ;S RESULT("headers","Temp")="Test"
+ N MSG
+ S MSG("message")="Hello, World!"
+ D ENCODE^%webjson("MSG","RESULT")
+ K MSG
+ Q

+ 25 - 0
frameworks/Mumps/m-web-server/benchmark_config.json

@@ -0,0 +1,25 @@
+{
+	"framework": "m-web-server",
+	"tests": [{
+		"default": {
+			"json_url": "/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "m-web-server",
+			"language": "mumps",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "m-web-server",
+			"os": "Linux",
+			"database_os": "None",
+			"display_name": "m-web-server",
+			"notes": "None",
+			"versus": "",
+			"tags": []
+		}
+	}]
+}
+

+ 41 - 0
frameworks/Mumps/m-web-server/m-web-server.dockerfile

@@ -0,0 +1,41 @@
+FROM yottadb/yottadb-base:latest
+
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt update && \
+    apt upgrade -y && \
+    apt install -y \
+    libcurl4-openssl-dev \
+    git
+
+# Install cURL plugin
+RUN git clone https://github.com/shabiel/fis-gtm-plugins.git
+ENV LD_LIBRARY_PATH /opt/yottadb/current
+RUN cd fis-gtm-plugins/libcurl && \
+    . /opt/yottadb/current/ydb_env_set && \
+    export gtm_dist=$ydb_dist && \
+    make install
+
+# Install M-Unit
+RUN git clone https://github.com/ChristopherEdwards/M-Unit.git munit
+
+RUN cd munit && \
+    mkdir r && \
+    cd Routines && \
+    for file in _*.m; do mv $file /data/munit/r/; done
+
+RUN git clone https://github.com/sumeetchhetri/M-Web-Server
+RUN mkdir -p /mwebserver/r && cp -rf M-Web-Server/src/* /mwebserver/r
+
+# Install M-Web-Server
+COPY _techempbenchmark.m /mwebserver/r/
+
+ENV GTMXC_libcurl "/opt/yottadb/current/plugin/libcurl_ydb_wrapper.xc"
+RUN . /opt/yottadb/current/ydb_env_set && \
+    export ydb_routines="/mwebserver/r /data/munit/r $ydb_routines" && \
+    mumps -r ^%webtest
+
+COPY run.sh ./
+RUN chmod +x run.sh
+
+CMD ./run.sh
+

+ 9 - 0
frameworks/Mumps/m-web-server/run.sh

@@ -0,0 +1,9 @@
+. /opt/yottadb/current/ydb_env_set
+export ydb_routines="/mwebserver/r /data/munit/r $ydb_routines"
+mupip rundown -f /tmp/yottadb/r1.30_x86_64/ydb-relinkctl-98fedd5406dbe07da4076a0607b49e01
+rm -f /tmp/yottadb/r1.30_x86_64/ydb-relinkctl-98fedd5406dbe07da4076a0607b49e01
+mumps -r ^%techempbenchmark
+while :
+do
+   sleep 1
+done