aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml12
-rw-r--r--docker/Dockerfile.webapp2
-rw-r--r--docker/base.Dockerfile2
-rw-r--r--docker/ci.Dockerfile2
-rw-r--r--tests/test_snekbox.py22
5 files changed, 17 insertions, 23 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 52bdf1b..405725d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,13 +1,15 @@
image: pythondiscord/snekbox-ci:latest
variables:
- DOCKER_DRIVER: overlay
- RMQ_HOST: rabbit
+ PIPENV_CACHE_DIR: "$CI_PROJECT_DIR/pipenv-cache"
+
+cache:
+ paths:
+ - "$CI_PROJECT_DIR/pipenv-cache"
+ - "$CI_PROJECT_DIR/.venv"
services:
- docker:dind
-# - name: rabbitmq:3.7.5-alpine
-# alias: rabbit
stages:
- build
@@ -18,7 +20,7 @@ build:
- pythondiscord
stage: build
script:
- - pipenv sync --dev
+ - pipenv install --dev --deploy
- pipenv run lint
- pipenv run test
- pipenv run buildbox
diff --git a/docker/Dockerfile.webapp b/docker/Dockerfile.webapp
index 55c326d..5546977 100644
--- a/docker/Dockerfile.webapp
+++ b/docker/Dockerfile.webapp
@@ -1,4 +1,4 @@
-FROM python:3.6-alpine3.7
+FROM python:3.6.6-alpine3.8
RUN apk add --update tini
RUN apk add --update build-base
diff --git a/docker/base.Dockerfile b/docker/base.Dockerfile
index ad2b7a1..6787283 100644
--- a/docker/base.Dockerfile
+++ b/docker/base.Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.6-alpine3.7
+FROM python:3.6.6-alpine3.8
RUN apk add --no-cache libstdc++ protobuf
RUN apk add --update build-base
diff --git a/docker/ci.Dockerfile b/docker/ci.Dockerfile
index e19bf7a..2163ffb 100644
--- a/docker/ci.Dockerfile
+++ b/docker/ci.Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.6-alpine3.7
+FROM python:3.6.6-alpine3.8
RUN apk add --no-cache libstdc++ protobuf build-base docker
diff --git a/tests/test_snekbox.py b/tests/test_snekbox.py
index 0a05881..e2505d6 100644
--- a/tests/test_snekbox.py
+++ b/tests/test_snekbox.py
@@ -50,19 +50,11 @@ class SnekTests(unittest.TestCase):
result = snek.python3(code)
self.assertIn('Resource temporarily unavailable', result.strip())
- # def test_juan_golf(self): # in honour of Juan
- # code = ("exec(type((lambda:0).code)(0,1,0,0,0,b'\x09\x00',(),(),(),'','',1,b''))")
- # result = snek.python3(code)
- # self.assertEquals('ValueError: embedded null byte', result.strip())
-
-#class RMQTests(unittest.TestCase):
-# @pytest.mark.dependency()
-# def test_a_publish(self):
-# message = json.dumps({"snekid": "test", "message": "print('test')"})
-# result = r.publish(message, queue='input')
-# self.assertTrue(result)
+ def test_juan_golf(self): # in honour of Juan
+ code = ("func = lambda: None\n"
+ "CodeType = type(func.__code__)\n"
+ "bytecode = CodeType(0,1,0,0,0,b'',(),(),(),'','',1,b'')\n"
+ "exec(bytecode)")
- # @pytest.mark.dependency(depends=["RMQTests::test_a_publish"])
- # def test_b_consume(self):
- # result = r.consume(callback=snek.message_handler, queue='input', run_once=True)
- # self.assertEquals(result[2], b'{"snekid": "test", "message": "print(\'test\')"}')
+ result = snek.python3(code)
+ self.assertEquals('unknown error, code: 111', result.strip())