mirror of
https://github.com/aelve/guide.git
synced 2024-12-23 04:42:24 +03:00
[Travis] Test loading the official database
This commit is contained in:
parent
60bbc6d71f
commit
5c64b2f36b
@ -66,6 +66,7 @@ script:
|
||||
- cabal test
|
||||
- cabal check
|
||||
- cabal sdist # tests that a source-distribution can be generated
|
||||
- ./scripts/test-official.sh
|
||||
|
||||
# Check that the resulting source distribution can be built & installed.
|
||||
# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
|
||||
|
20
scripts/test-official.sh
Executable file
20
scripts/test-official.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
set -ev
|
||||
|
||||
# Test that the official database can be loaded
|
||||
|
||||
if [ -d "state" ]; then
|
||||
mv state state-old
|
||||
fi
|
||||
|
||||
git clone --depth 1 https://github.com/aelve/guide-database.git
|
||||
mv guide-database state
|
||||
|
||||
cabal build
|
||||
dist/build/guide/guide --dry-run
|
||||
|
||||
rm -rf state
|
||||
|
||||
if [ -d "state-old" ]; then
|
||||
mv state-old state
|
||||
fi
|
@ -451,6 +451,11 @@ main = do
|
||||
_categoriesDeleted = [],
|
||||
_pendingEdits = [],
|
||||
_editIdCounter = 0 }
|
||||
do args <- getArgs
|
||||
when (args == ["--dry-run"]) $ do
|
||||
db :: DB <- openLocalStateFrom "state/" (error "couldn't load state")
|
||||
closeAcidState db
|
||||
exitSuccess
|
||||
-- When we run in GHCi and we exit the main thread, the EKG thread (that
|
||||
-- runs the localhost:5050 server which provides statistics) may keep
|
||||
-- running. This makes running this in GHCi annoying, because you have to
|
||||
|
@ -252,9 +252,6 @@ genVer tyName ver constructors = do
|
||||
[]
|
||||
return [decl]
|
||||
|
||||
-- TODO: [easy] add a test that takes data from aelve/guide-database and
|
||||
-- checks that the data can be loaded
|
||||
|
||||
data MigrateConstructor = CopyM Name | CustomM Name ExpQ
|
||||
|
||||
migrateVer :: Name -> Int -> [MigrateConstructor] -> Q Exp
|
||||
|
Loading…
Reference in New Issue
Block a user