Commit 91649564 authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

Added benchmarking

parent 9fdb943e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ stages:
  - prebuild
  - compile
  - test
  - efficiency

include:
  - local: 'ci_cd/problem3.yml'   # FullInteger
+30 −0
Original line number Diff line number Diff line
@@ -47,3 +47,33 @@ exec_problem_3:
    - if: '$CI_COMMIT_REF_NAME == "problem3"'
  tags: [c++-17]

benchmark:
  stage: efficiency
  needs:
    - job: exec_problem_3
      artifacts: true
  script:
    - git clone https://trachten-gitlab:${HW_INTERNAL}@agile.bu.edu/gitlab/ec330/ec330_staff/homeworks_internal/hw3_ec.git hw3_ec
    - cp FullInteger.cpp IntegerPP.cpp hw3_ec/impl
    - cd hw3_ec
    - make extra3
    - set -o pipefail
    - |
      set +e
      timeout 300s stdbuf -oL ./extra3 | tee extra3.out
      STATUS=${PIPESTATUS[0]}
      set -e
      if [ "$STATUS" -eq 255 ]; then
        echo "computed result incorrect - job failed"
        exit 1
      fi
      
      context="$(tail -n 10 extra3.out)"
      score="$(tail -n 1 extra3.out | tr -d '[:space:]')"
    - echo "$context"
    - curl "https://agile.bu.edu/ec330_scripts/saveScores.pl?key=${MAGIC_KEY}&file=hw3bench&name=${GITLAB_USER_LOGIN}&score=${score}"
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem3"'
  timeout: 10m
  # tags: [c++-17-light]
  tags: [c++-17]