update for GEval 1.1.0.0

This commit is contained in:
Filip Graliński 2018-06-29 08:05:33 +02:00
parent 4ec90bdb10
commit 306d9d0af6
3 changed files with 6 additions and 4 deletions

View File

@ -34,6 +34,8 @@ import Data.Attoparsec.Text
import Data.Text (pack, unpack) import Data.Text (pack, unpack)
import Data.Conduit.SmartSource
getShowChallengeR :: Text -> Handler Html getShowChallengeR :: Text -> Handler Html
getShowChallengeR name = do getShowChallengeR name = do
(Entity challengeId challenge) <- runDB $ getBy404 $ UniqueName name (Entity challengeId challenge) <- runDB $ getBy404 $ UniqueName name
@ -325,7 +327,7 @@ checkOrInsertEvaluation repoDir chan out = do
case resultOrException of case resultOrException of
Right (Left _) -> do Right (Left _) -> do
err chan "Cannot parse options, check the challenge repo" err chan "Cannot parse options, check the challenge repo"
Right (Right (_, Just [result])) -> do Right (Right (_, Just [(_, [result])])) -> do
msg chan $ concat [ "Evaluated! Score ", (T.pack $ show result) ] msg chan $ concat [ "Evaluated! Score ", (T.pack $ show result) ]
time <- liftIO getCurrentTime time <- liftIO getCurrentTime
_ <- runDB $ insert $ Evaluation { _ <- runDB $ insert $ Evaluation {
@ -342,7 +344,7 @@ checkOrInsertEvaluation repoDir chan out = do
Left exception -> do Left exception -> do
err chan $ "Evaluation failed: " ++ (T.pack $ show exception) err chan $ "Evaluation failed: " ++ (T.pack $ show exception)
rawEval :: FilePath -> Metric -> FilePath -> Text -> IO (Either GEvalException (Either (ParserResult GEvalOptions) (GEvalOptions, Maybe [MetricValue]))) rawEval :: FilePath -> Metric -> FilePath -> Text -> IO (Either GEvalException (Either (ParserResult GEvalOptions) (GEvalOptions, Maybe [(SourceSpec, [MetricValue])])))
rawEval challengeDir metric repoDir name = Import.try (runGEvalGetOptions [ rawEval challengeDir metric repoDir name = Import.try (runGEvalGetOptions [
"--alt-metric", (show metric), "--alt-metric", (show metric),
"--expected-directory", challengeDir, "--expected-directory", challengeDir,

View File

@ -122,7 +122,7 @@ library
, filemanip , filemanip
, cryptohash , cryptohash
, markdown , markdown
, geval >= 1.0.0.0 , geval >= 1.1.0.0 && < 1.2
, filepath , filepath
, yesod-table , yesod-table
, regex-tdfa , regex-tdfa

View File

@ -8,7 +8,7 @@ packages:
git: https://github.com/bitemyapp/esqueleto git: https://github.com/bitemyapp/esqueleto
commit: b81e0d951e510ebffca03c5a58658ad884cc6fbd commit: b81e0d951e510ebffca03c5a58658ad884cc6fbd
extra-dep: true extra-dep: true
extra-deps: [../geval,wai-handler-fastcgi-3.0.0.2,murmur3-1.0.3,random-strings-0.1.1.0] extra-deps: [../geval,wai-handler-fastcgi-3.0.0.2,murmur3-1.0.3,random-strings-0.1.1.0,naturalcomp-0.0.3]
resolver: lts-11.9 resolver: lts-11.9
image: image:
container: container: