Remove no assistant tests from integration tests (#5240)

There was a brief period of time where `daml build` did not work
outside of the assistant. When we fixed that we added it to the
integration tests since there was no other test suite that used damlc
as a binary (as opposed to using it as a library which runs through
different codepaths). However, in the meantime we have tons of tests
all over the place (e.g. the packaging tests) that call `damlc build`
outside of the assistant so these tests serve no purpose.
Also they are somewhat confusing since the point of the integration
tests is to test an installed SDK whereas these tests do not need an
installed SDK (that’s the whole point of those tests).

changelog_begin
changelog_end
This commit is contained in:
Moritz Kiefer 2020-03-27 13:11:10 +01:00 committed by GitHub
parent b398272fee
commit 9a1ddc8fa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,11 +64,10 @@ main = do
] $ defaultMain (tests tmpDir damlTypesDir))
tests :: FilePath -> FilePath -> TestTree
tests tmpDir damlTypesDir = withSdkResource $ \getSdkDir -> testGroup "Integration tests"
tests tmpDir damlTypesDir = withSdkResource $ \_ -> testGroup "Integration tests"
[ testCase "daml version" $ callCommandQuiet "daml version"
, testCase "daml --help" $ callCommandQuiet "daml --help"
, testCase "daml new --list" $ callCommandQuiet "daml new --list"
, noassistantTests getSdkDir
, packagingTests
, quickstartTests quickstartDir mvnDir
, cleanTests cleanDir
@ -112,49 +111,6 @@ withSdkResource f =
throwError :: MonadFail m => T.Text -> T.Text -> m ()
throwError msg e = fail (T.unpack $ msg <> " " <> e)
-- | These tests check that it is possible to invoke (a subset) of damlc
-- commands outside of the assistant.
noassistantTests :: IO FilePath -> TestTree
noassistantTests getSdkDir = testGroup "no assistant"
[ testCase "damlc build --init-package-db=no" $ withTempDir $ \projDir -> do
writeFileUTF8 (projDir </> "daml.yaml") $ unlines
[ "sdk-version: " <> sdkVersion
, "name: a"
, "version: \"1.0\""
, "source: Main.daml"
, "dependencies: [daml-prim, daml-stdlib]"
]
writeFileUTF8 (projDir </> "Main.daml") $ unlines
[ "daml 1.2"
, "module Main where"
, "a : ()"
, "a = ()"
]
sdkDir <- getSdkDir
let damlcPath = sdkDir </> "sdk" </> sdkVersion </> "damlc" </> "damlc"
callProcess damlcPath ["build", "--project-root", projDir, "--init-package-db", "no"]
, testCase "damlc build --init-package-db=yes" $ withTempDir $ \tmpDir -> do
let projDir = tmpDir </> "foobar"
createDirectory projDir
writeFileUTF8 (projDir </> "daml.yaml") $ unlines
[ "sdk-version: " <> sdkVersion
, "name: a"
, "version: \"1.0\""
, "source: Main.daml"
, "dependencies: [daml-prim, daml-stdlib]"
]
writeFileUTF8 (projDir </> "Main.daml") $ unlines
[ "daml 1.2"
, "module Main where"
, "a : ()"
, "a = ()"
]
sdkDir <- getSdkDir
let damlcPath = sdkDir </> "sdk" </> sdkVersion </> "damlc" </> "damlc"
withCurrentDirectory tmpDir $
callProcess damlcPath ["build", "--project-root", "foobar", "--init-package-db", "yes"]
]
-- Most of the packaging tests are in the a separate test suite in
-- //compiler/damlc/tests:packaging. This only has a couple of
-- integration tests.