on develop help sign in
Merge pull request #340 from reflex-frp/aa-fix-hydration-test-dep

hydration: Use staticWhich to find chromium

commitf4735792c9f39a396bda4666cb2542085d10bc1a authorAli Abrar <aliabrar@gmail.com> dateWed 13 Nov 2019, 20:18 (7 years ago) parent8a2e27c5b94a5c
4 files changed+9−3
dep/reflex-platform/github.json+2−2 reflex-dom-core/ChangeLog.md+1 reflex-dom-core/reflex-dom-core.cabal+1 reflex-dom-core/test/hydration.hs+5−1
dep/reflex-platform/github.json+2−2
@@ -2,6 +2,6 @@
22 "owner": "reflex-frp",
33 "repo": "reflex-platform",
44 "branch": "develop",
5− "rev": "8f4b8973a06f78c7aaf1a222f8f8443cd934569f",
6− "sha256": "167smg7dyvg5yf1wn9bx6yxvazlk0qk64rzgm2kfzn9mx873s0vp"
5+ "rev": "338fc907e37d70e6469c529456f33221fb05ca1f",
6+ "sha256": "08gfhpp0pkvvi1wnlpcn6wmpzdjvy5z7dy1h66gp2w8b5cx8hx5h"
77}
reflex-dom-core/ChangeLog.md+1
@@ -7,6 +7,7 @@
77* Update to use new dependent-sum/map packages and drop dependency on `*Tag` classes (e.g., `ShowTag`).
88* Reintroduce "data-ssr": elements without this attribute are skipped during
99 hydration.
10+* Fix an issue in the hydration tests that prevented the test from finding the chromium executable
1011
1112## 0.5.1
1213
reflex-dom-core/reflex-dom-core.cabal+1
@@ -190,6 +190,7 @@ test-suite hydration
190190 , warp
191191 , webdriver
192192 , websockets
193+ , which
193194 hs-source-dirs: test
194195 ghc-options: -rtsopts -with-rtsopts=-T -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
195196 ghc-prof-options: -fprof-auto -optP-DPROFILING
reflex-dom-core/test/hydration.hs+5−1
@@ -52,6 +52,7 @@ import System.IO (stderr)
5252import System.IO.Silently
5353import System.IO.Temp
5454import System.Process
55+import System.Which (staticWhich)
5556import qualified Test.HUnit as HUnit (assertEqual, assertFailure)
5657import qualified Test.Hspec as H
5758import qualified Test.Hspec.Core.Spec as H
@@ -74,6 +75,9 @@ import qualified Test.WebDriver.Capabilities as WD
7475import Test.Util.ChromeFlags
7576import Test.Util.UnshareNetwork
7677
78+chromium :: FilePath
79+chromium = $(staticWhich "chromium")
80+
7781seleniumPort, jsaddlePort :: PortNumber
7882seleniumPort = 8000
7983jsaddlePort = 8001
@@ -123,7 +127,7 @@ main = do
123127 isHeadless <- (== Nothing) <$> lookupEnv "NO_HEADLESS"
124128 withSandboxedChromeFlags isHeadless $ \chromeFlags -> do
125129 withSeleniumServer $ \selenium -> do
126− browserPath <- liftIO $ T.strip . T.pack <$> readProcess "which" [ "chromium" ] ""
130+ let browserPath = T.strip $ T.pack chromium
127131 when (T.null browserPath) $ fail "No browser found"
128132 withDebugging <- isNothing <$> lookupEnv "NO_DEBUG"
129133 let wdConfig = WD.defaultConfig { WD.wdPort = fromIntegral $ _selenium_portNumber selenium }