Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
run: cabal update

- name: Disable some tests
run: echo CABAL_CONFIG_FLAGS="-f-hack-tests -f-flow-tests -f-rust-tests -f-python-tests" >> "$GITHUB_ENV"
run: echo CABAL_CONFIG_FLAGS="-f-hack-tests -f-rust-tests -f-python-tests" >> "$GITHUB_ENV"

- name: Install hsthrift and Glean dependencies
run: sudo apt-get install -y pkg-config rsync libgmock-dev libpcre3-dev libtinfo-dev libxxhash-dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
make setup-folly-version

- name: Disable some tests
run: echo CABAL_CONFIG_FLAGS="$CABAL_CONFIG_FLAGS -f-hack-tests -f-flow-tests -f-rust-tests -f-python-tests" >> "$GITHUB_ENV"
run: echo CABAL_CONFIG_FLAGS="$CABAL_CONFIG_FLAGS -f-hack-tests -f-rust-tests -f-python-tests" >> "$GITHUB_ENV"

- name: Setup index-state
run: echo CABAL_CONFIG_FLAGS="$CABAL_CONFIG_FLAGS --index-state=${{ matrix.index-state }}" >>"$GITHUB_ENV"
Expand Down
10 changes: 6 additions & 4 deletions glean/glass/test/regression/Glean/Glass/Regression/Flow/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
LICENSE file in the root directory of this source tree.
-}

module Glean.Glass.Regression.Flow.Main (main) where
module Glean.Glass.Regression.Flow.Main ( main ) where

import Glean.Indexer.Flow as Flow ( indexer )
import Glean.Glass.Regression.Snapshot ( mainGlassSnapshotCLI )
import System.Environment
import qualified Glean.Glass.Regression.Flow as Glass

main :: IO ()
main = mainGlassSnapshotCLI Flow.indexer (const [])
main = getArgs >>= \args -> withArgs (args ++["--root", path, "--write-root", "test"]) $ Glass.main
where
path = "glean/lang/codemarkup/tests/flow/cases/xrefs"
10 changes: 6 additions & 4 deletions glean/glass/test/regression/Glean/Glass/Regression/Hack/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
LICENSE file in the root directory of this source tree.
-}

module Glean.Glass.Regression.Hack.Main (main) where
module Glean.Glass.Regression.Hack.Main ( main ) where

import Glean.Indexer.Hack as Hack ( indexer )
import Glean.Glass.Regression.Snapshot ( mainGlassSnapshotCLI )
import System.Environment
import qualified Glean.Glass.Regression.Hack as Glass

main :: IO ()
main = mainGlassSnapshotCLI Hack.indexer (const [])
main = getArgs >>= \args -> withArgs (["--root", path] ++ args) Glass.main
where
path = "glean/lang/codemarkup/tests/hack/cases/xrefs"
47 changes: 0 additions & 47 deletions glean/glass/test/regression/lib/Glean/Glass/Regression/Snapshot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

module Glean.Glass.Regression.Snapshot (
mainGlassSnapshot,
mainGlassSnapshotCLI,
mainGlassSnapshotGeneric,
mainGlassSnapshotXLang,
Output, Getter
Expand All @@ -41,7 +40,6 @@ import qualified Data.Map.Strict as Map
import qualified Data.Yaml as Yaml
import Util.List ( uniq )
import Data.Either.Extra
import System.IO.Unsafe ( unsafePerformIO )

import qualified Thrift.Protocol
import qualified Thrift.Protocol.JSON as Thrift
Expand Down Expand Up @@ -122,51 +120,6 @@ mainGlassSnapshot testName testRoot indexer extras =
mainGlassSnapshot_ testName testRoot
(Glean.driverFromIndexer indexer) extras

-- | Like 'mainGlassSnapshot', but reads testName and testPath from
-- command-line arguments (--test-name and --test-path).
-- This allows a single module to be reused for multiple test targets.
mainGlassSnapshotCLI
:: Glean.Indexer opts
-> (Getter -> [Test])
-> IO ()
mainGlassSnapshotCLI indexer extras =
mainGlassSnapshotCLI_ (Glean.driverFromIndexer indexer) extras

-- | Configuration parsed from CLI for test name and path
data TestPathConfig = TestPathConfig
{ tpcTestName :: String
, tpcTestPath :: FilePath
}

testPathConfigParser :: Parser TestPathConfig
testPathConfigParser = TestPathConfig
<$> strOption
( long "test-name"
<> metavar "NAME"
<> help "Name for the test suite" )
<*> strOption
( long "test-path"
<> metavar "PATH"
<> help "Path to test directory containing .query files" )

mainGlassSnapshotCLI_
:: Glean.Driver opts
-> (Getter -> [Test])
-> IO ()
mainGlassSnapshotCLI_ driver extras = do
withOutput cfgOutput $ \temp ->
mainTestIndexGeneric driver combinedParser "" $
\(snapConfig, TestPathConfig{..}) _ config _ get ->
let qs = unsafePerformIO $ findQueries tpcTestPath
in TestList $ testAll snapConfig config temp qs get : extras get
where
cfgOutput = Nothing

combinedParser = (,) <$> configParser <*> testPathConfigParser

withOutput (Just out) f = f out
withOutput Nothing f = withSystemTempDirectory "glass-test" f

mainGlassSnapshotGeneric
:: String
-> FilePath
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading