From 275e36d8c9e8ccd4501624562dbe099c8e1c0f88 Mon Sep 17 00:00:00 2001
From: Recolic Keghart <root@recolic.net>
Date: Mon, 8 Apr 2019 21:08:17 -0700
Subject: [PATCH] edit gitlab-ci: dont allow failure anymore!!!

---
 .gitlab-ci.yml | 1 -
 run.sh         | 4 +++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4ac92f0..903b865 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -38,7 +38,6 @@ test-positive-whole:
     - ./run.sh parse src/test/data/pa2/sample/ast_coverage.py ast_coverage.ast.gi
     - ./run.sh type ast_coverage.ast.gi ast_coverage.typed.gi
     - diff ast_coverage.typed.gi src/test/data/pa2/sample/ast_coverage.py.ast.typed
-  allow_failure: true
 
 # code_quality:
 #   image: docker:stable
diff --git a/run.sh b/run.sh
index 3dcbe1d..abec674 100755
--- a/run.sh
+++ b/run.sh
@@ -12,7 +12,9 @@ if [[ "$task" = parse ]]; then
 elif [[ "$task" = type ]]; then
     java -cp "$classPath" chocopy.ChocoPy --pass=.s --out "$output" "$input"
 elif [[ "$task" = ass ]]; then
-    java -cp "$classPath" chocopy.ChocoPy --pass=.s --dir src/test/data/pa2/sample --test
+    java -cp "$classPath" chocopy.ChocoPy --pass=.s --dir src/test/data/pa2/sample --test | tee /tmp/cs164_ass.log
+    # Should pass all positive test, else return error_code=2
+    cat /tmp/cs164_ass.log | grep Test: | grep failed | grep -v sample/bad_ && exit 2 || exit 0
 elif [[ "$task" = build ]]; then
     mvn clean package > /dev/null 2>&1 && echo success || echo failed
 fi
-- 
GitLab