test(spec): remove obsolete ANALYZE calls
These are now part of the with- helpers.
This commit is contained in:
+2
-10
@@ -132,12 +132,7 @@ main = do
|
|||||||
timezoneDisabled = appDbs testCfgTimezoneDisabled
|
timezoneDisabled = appDbs testCfgTimezoneDisabled
|
||||||
|
|
||||||
|
|
||||||
let analyze :: IO ()
|
let specs = uncurry describe <$> [
|
||||||
analyze = do
|
|
||||||
analyzeTable "items"
|
|
||||||
analyzeTable "child_entities"
|
|
||||||
|
|
||||||
specs = uncurry describe <$> [
|
|
||||||
("Feature.Auth.AudienceJwtSecretSpec" , Feature.Auth.AudienceJwtSecretSpec.disabledSpec)
|
("Feature.Auth.AudienceJwtSecretSpec" , Feature.Auth.AudienceJwtSecretSpec.disabledSpec)
|
||||||
, ("Feature.Auth.AuthSpec" , Feature.Auth.AuthSpec.spec)
|
, ("Feature.Auth.AuthSpec" , Feature.Auth.AuthSpec.spec)
|
||||||
, ("Feature.ConcurrentSpec" , Feature.ConcurrentSpec.spec)
|
, ("Feature.ConcurrentSpec" , Feature.ConcurrentSpec.spec)
|
||||||
@@ -160,6 +155,7 @@ main = do
|
|||||||
, ("Feature.Query.Preferences.HandlingSpec" , Feature.Query.Preferences.HandlingSpec.spec)
|
, ("Feature.Query.Preferences.HandlingSpec" , Feature.Query.Preferences.HandlingSpec.spec)
|
||||||
, ("Feature.Query.Preferences.MaxAffectedSpec" , Feature.Query.Preferences.MaxAffectedSpec.spec)
|
, ("Feature.Query.Preferences.MaxAffectedSpec" , Feature.Query.Preferences.MaxAffectedSpec.spec)
|
||||||
, ("Feature.Query.QuerySpec" , Feature.Query.QuerySpec.spec)
|
, ("Feature.Query.QuerySpec" , Feature.Query.QuerySpec.spec)
|
||||||
|
, ("Feature.Query.RangeSpec" , Feature.Query.RangeSpec.spec)
|
||||||
, ("Feature.Query.RawOutputTypesSpec" , Feature.Query.RawOutputTypesSpec.spec)
|
, ("Feature.Query.RawOutputTypesSpec" , Feature.Query.RawOutputTypesSpec.spec)
|
||||||
, ("Feature.Query.RelatedQueriesSpec" , Feature.Query.RelatedQueriesSpec.spec)
|
, ("Feature.Query.RelatedQueriesSpec" , Feature.Query.RelatedQueriesSpec.spec)
|
||||||
, ("Feature.Query.RpcSpec" , Feature.Query.RpcSpec.spec actualPgVersion)
|
, ("Feature.Query.RpcSpec" , Feature.Query.RpcSpec.spec actualPgVersion)
|
||||||
@@ -172,10 +168,6 @@ main = do
|
|||||||
hspec $ do
|
hspec $ do
|
||||||
mapM_ (parallel . before withApp) specs
|
mapM_ (parallel . before withApp) specs
|
||||||
|
|
||||||
-- we analyze to get accurate results from EXPLAIN
|
|
||||||
parallel $ beforeAll_ analyze . before withApp $
|
|
||||||
describe "Feature.Query.RangeSpec" Feature.Query.RangeSpec.spec
|
|
||||||
|
|
||||||
-- this test runs with a different server flag
|
-- this test runs with a different server flag
|
||||||
parallel $ before maxRowsApp $
|
parallel $ before maxRowsApp $
|
||||||
describe "Feature.Query.QueryLimitedSpec" Feature.Query.QueryLimitedSpec.spec
|
describe "Feature.Query.QueryLimitedSpec" Feature.Query.QueryLimitedSpec.spec
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import Data.List (lookup)
|
|||||||
import Data.List.NonEmpty (fromList)
|
import Data.List.NonEmpty (fromList)
|
||||||
import Network.Wai.Test (SResponse (simpleBody, simpleHeaders, simpleStatus))
|
import Network.Wai.Test (SResponse (simpleBody, simpleHeaders, simpleStatus))
|
||||||
import System.IO.Unsafe (unsafePerformIO)
|
import System.IO.Unsafe (unsafePerformIO)
|
||||||
import System.Process (readProcess)
|
|
||||||
import Text.Regex.TDFA ((=~))
|
import Text.Regex.TDFA ((=~))
|
||||||
|
|
||||||
|
|
||||||
@@ -256,10 +255,6 @@ testCfgAggregatesEnabled = baseCfg { configDbAggregates = True }
|
|||||||
testCfgTimezoneDisabled :: AppConfig
|
testCfgTimezoneDisabled :: AppConfig
|
||||||
testCfgTimezoneDisabled = baseCfg { configDbTimezoneEnabled = False }
|
testCfgTimezoneDisabled = baseCfg { configDbTimezoneEnabled = False }
|
||||||
|
|
||||||
analyzeTable :: Text -> IO ()
|
|
||||||
analyzeTable tableName =
|
|
||||||
void $ readProcess "psql" ["-U", "postgres", "--set", "ON_ERROR_STOP=1", "-a", "-c", toS $ "ANALYZE test.\"" <> tableName <> "\""] []
|
|
||||||
|
|
||||||
rangeHdrs :: ByteRange -> [Header]
|
rangeHdrs :: ByteRange -> [Header]
|
||||||
rangeHdrs r = [rangeUnit, (hRange, renderByteRange r)]
|
rangeHdrs r = [rangeUnit, (hRange, renderByteRange r)]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user