variant is now required for an out
This commit is contained in:
parent
970e8ecf25
commit
eedf1cd6fa
@ -281,8 +281,7 @@ getOuts chan submissionId = do
|
|||||||
activeTests <- runDB $ selectList [TestChallenge ==. challengeId, TestActive ==. True] []
|
activeTests <- runDB $ selectList [TestChallenge ==. challengeId, TestActive ==. True] []
|
||||||
testsDone <- filterM (liftIO . doesOutExist repoDir) activeTests
|
testsDone <- filterM (liftIO . doesOutExist repoDir) activeTests
|
||||||
theVariant <- getVariant submissionId "out"
|
theVariant <- getVariant submissionId "out"
|
||||||
outs' <- mapM (outForTest repoDir submissionId) testsDone
|
outs <- mapM (outForTest repoDir submissionId theVariant) testsDone
|
||||||
let outs = map (\o -> o { outVariant = Just theVariant}) outs'
|
|
||||||
mapM_ checkOrInsertOut outs
|
mapM_ checkOrInsertOut outs
|
||||||
mapM_ (checkOrInsertEvaluation repoDir chan) outs
|
mapM_ (checkOrInsertEvaluation repoDir chan) outs
|
||||||
return outs
|
return outs
|
||||||
@ -299,12 +298,12 @@ doesOutExist repoDir (Entity _ test) = do
|
|||||||
result <- findOutFile repoDir test
|
result <- findOutFile repoDir test
|
||||||
return $ isJust result
|
return $ isJust result
|
||||||
|
|
||||||
outForTest repoDir submissionId (Entity testId test) = do
|
outForTest repoDir submissionId variantId (Entity testId test) = do
|
||||||
(Just outF) <- liftIO $ findOutFile repoDir test
|
(Just outF) <- liftIO $ findOutFile repoDir test
|
||||||
checksum <- liftIO $ gatherSHA1ForCollectionOfFiles [outF]
|
checksum <- liftIO $ gatherSHA1ForCollectionOfFiles [outF]
|
||||||
return Out {
|
return Out {
|
||||||
outSubmission=submissionId,
|
outSubmission=submissionId,
|
||||||
outVariant=Nothing,
|
outVariant=variantId,
|
||||||
outTest=testId,
|
outTest=testId,
|
||||||
outChecksum=SHA1 checksum }
|
outChecksum=SHA1 checksum }
|
||||||
|
|
||||||
|
@ -81,10 +81,11 @@ Comment
|
|||||||
text Textarea
|
text Textarea
|
||||||
Out
|
Out
|
||||||
submission SubmissionId
|
submission SubmissionId
|
||||||
variant VariantId Maybe
|
variant VariantId
|
||||||
test TestId
|
test TestId
|
||||||
checksum SHA1
|
checksum SHA1
|
||||||
UniqueOutSubmissionTestChecksum submission test checksum
|
UniqueOutSubmissionTestChecksum submission test checksum
|
||||||
|
UniqueOutVariantTestChecksum variant test checksum
|
||||||
Tag
|
Tag
|
||||||
name Text
|
name Text
|
||||||
description Text Maybe
|
description Text Maybe
|
||||||
|
Loading…
Reference in New Issue
Block a user