on develop help sign in
Merge pull request #293 from reflex-frp/km-chromedriver-utils-package

Move Chrome test utils into top-level package to make it work in nix-build

commit14da2f1e3be1f6c9d77615675c0c8ef193af07d2 authorAli Abrar <aliabrar@gmail.com> dateFri 8 Mar 2019, 15:11 (8 years ago) parent2c7ac7ec649cb1
7 files changed+50−22
chrome-test-utils/LICENSE+12 chrome-test-utils/chrome-test-utils.cabal+30 reflex-dom-core/src-chromedriver-utils/Test/Util/ChromeFlags.hs → chrome-test-utils/src/Test/Util/ChromeFlags.hs reflex-dom-core/src-chromedriver-utils/Test/Util/UnshareNetwork.hs → chrome-test-utils/src/Test/Util/UnshareNetwork.hs default.nix+1 reflex-dom-core/default.nix+5−5 reflex-dom-core/reflex-dom-core.cabal+2−17
chrome-test-utils/LICENSEnew file+12
@@ -0,0 +1,12 @@
1+Copyright (c) 2019, Obsidian Systems LLC
2+All rights reserved.
3+
4+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
chrome-test-utils/chrome-test-utils.cabalnew file+30
@@ -0,0 +1,30 @@
1+Name: chrome-test-utils
2+Version: 0.4
3+Synopsis: Utilities to write headless Chromium tests
4+License: BSD3
5+License-file: LICENSE
6+Author: Obsidian Systems LLC
7+Maintainer: maintainer@obsidian.systems
8+Stability: Experimental
9+Build-type: Simple
10+Cabal-version: >=1.9.2
11+
12+library
13+ hs-source-dirs: src
14+ ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
15+ build-depends: base
16+ , linux-namespaces
17+ , process
18+ , temporary
19+ , text
20+ , unix
21+ exposed-modules:
22+ Test.Util.UnshareNetwork
23+ Test.Util.ChromeFlags
24+ if !os(linux) || !arch(x86_64)
25+ buildable: False
26+
27+source-repository head
28+ type: git
29+ location: https://github.com/reflex-frp/reflex-dom
30+ subdir: chrome-test-utils
reflex-dom-core/src-chromedriver-utils/Test/Util/ChromeFlags.hs → chrome-test-utils/src/Test/Util/ChromeFlags.hsrenamed

The content is the same.

reflex-dom-core/src-chromedriver-utils/Test/Util/UnshareNetwork.hs → chrome-test-utils/src/Test/Util/UnshareNetwork.hsrenamed

The content is the same.

default.nix+1
@@ -3,4 +3,5 @@ haskellPackages: nixpkgs: {
33 reflex-dom-core = haskellPackages.callPackage ./reflex-dom-core {
44 inherit (nixpkgs) iproute chromium;
55 };
6+ chrome-test-utils = haskellPackages.callCabal2nix "chrome-test-utils" ./chrome-test-utils {};
67}
reflex-dom-core/default.nix+5−5
@@ -1,9 +1,9 @@
11{ mkDerivation, aeson, base, bifunctors, bimap, blaze-builder
2−, bytestring, constraints, constraints-extras, containers
2+, bytestring, chrome-test-utils, constraints, constraints-extras, containers
33, contravariant, data-default, dependent-map, dependent-sum
44, dependent-sum-template, directory, exception-transformers
55, exceptions, filepath, ghcjs-dom, hlint, hspec, hspec-webdriver, http-types, HUnit
6−, jsaddle, jsaddle-warp, keycode, lens, lifted-base, linux-namespaces
6+, jsaddle, jsaddle-warp, keycode, lens, lifted-base
77, monad-control, mtl, network, network-uri, primitive, process
88, random, ref-tf, reflex, semigroups, silently, stdenv, stm
99, template-haskell, temporary, text, these, transformers, unix, wai
@@ -15,7 +15,7 @@ let addGcTestDepends = drv: if (stdenv.system != "x86_64-linux" || stdenv.hostPl
1515 preCheck = ''
1616 export FONTCONFIG_PATH=${fontconfig.out}/etc/fonts
1717 '';
18− testHaskellDepends = (drv.testHaskellDepends or []) ++ [ temporary jsaddle-warp process linux-namespaces ];
18+ testHaskellDepends = (drv.testHaskellDepends or []) ++ [ temporary jsaddle-warp process ];
1919 testSystemDepends = (drv.testSystemDepends or []) ++ [ chromium iproute ];
2020 };
2121in mkDerivation (addGcTestDepends {
@@ -46,10 +46,10 @@ in mkDerivation (addGcTestDepends {
4646
4747 testSystemDepends = [ selenium-server-standalone which ];
4848 testHaskellDepends = [
49− aeson base bytestring constraints constraints-extras containers
49+ aeson base bytestring chrome-test-utils constraints constraints-extras containers
5050 dependent-map dependent-sum dependent-sum-template directory
5151 exceptions filepath ghcjs-dom hlint hspec hspec-webdriver http-types HUnit jsaddle
52− jsaddle-warp lens lifted-base linux-namespaces network process random reflex
52+ jsaddle-warp lens lifted-base network process random reflex
5353 silently temporary text unix wai wai-websockets warp webdriver
5454 websockets
5555 ];
reflex-dom-core/reflex-dom-core.cabal+2−17
@@ -153,7 +153,7 @@ test-suite hydration
153153 build-depends: base
154154 , aeson
155155 , bytestring
156− , chromedriver-utils
156+ , chrome-test-utils
157157 , constraints
158158 , constraints-extras
159159 , containers
@@ -198,7 +198,7 @@ test-suite hydration
198198-- needs to be updated for changes in GHC.Stats
199199test-suite gc
200200 build-depends: base
201− , chromedriver-utils
201+ , chrome-test-utils
202202 , jsaddle
203203 , jsaddle-warp
204204 , process
@@ -213,21 +213,6 @@ test-suite gc
213213 if !os(linux) || !arch(x86_64)
214214 buildable: False
215215
216−library chromedriver-utils
217− hs-source-dirs: src-chromedriver-utils
218− ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
219− build-depends: base
220− , linux-namespaces
221− , process
222− , temporary
223− , text
224− , unix
225− exposed-modules:
226− Test.Util.UnshareNetwork
227− Test.Util.ChromeFlags
228− if !os(linux) || !arch(x86_64)
229− buildable: False
230−
231216source-repository head
232217 type: git
233218 location: https://github.com/reflex-frp/reflex-dom