mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 09:22:41 +03:00
Enable Enso asserts on CI (#7929)
--------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
997e0fc465
commit
c525698e5c
@ -1,6 +1,7 @@
|
||||
use crate::prelude::*;
|
||||
|
||||
use crate::paths::Paths;
|
||||
use crate::paths::ENSO_ENABLE_ASSERTIONS;
|
||||
use crate::paths::ENSO_META_TEST_ARGS;
|
||||
use crate::paths::ENSO_META_TEST_COMMAND;
|
||||
use crate::postgres;
|
||||
@ -119,6 +120,8 @@ impl BuiltEnso {
|
||||
ENSO_META_TEST_COMMAND.set(&self.wrapper_script_path())?;
|
||||
ENSO_META_TEST_ARGS.set(&format!("{} --run", ir_caches.flag()))?;
|
||||
|
||||
ENSO_ENABLE_ASSERTIONS.set("true")?;
|
||||
|
||||
// Prepare Engine Test Environment
|
||||
if let Ok(gdoc_key) = std::env::var("GDOC_KEY") {
|
||||
let google_api_test_data_dir =
|
||||
|
@ -29,6 +29,9 @@ ide_ci::define_env_var! {
|
||||
/// Arguments to the engine runner.
|
||||
/// See: <https://github.com/diab0l/enso/blob/feature/test_with_clue/test/Meta_Test_Suite_Tests/README.md>
|
||||
ENSO_META_TEST_ARGS, String;
|
||||
|
||||
/// If Enso-specific assertions should be enabled.
|
||||
ENSO_ENABLE_ASSERTIONS, String;
|
||||
}
|
||||
|
||||
pub const EDITION_FILE_ARTIFACT_NAME: &str = "Edition File";
|
||||
|
@ -65,6 +65,7 @@ import project.Network.Http_Spec
|
||||
import project.Network.URI_Spec
|
||||
|
||||
import project.Runtime.Ascribed_Parameters_Spec
|
||||
import project.Runtime.Asserts_Spec
|
||||
import project.Runtime.Lazy_Spec
|
||||
import project.Runtime.Lazy_Generator_Spec
|
||||
import project.Runtime.Managed_Resource_Spec
|
||||
@ -132,6 +133,7 @@ main = Test_Suite.run_main <|
|
||||
Ref_Spec.spec
|
||||
Regex_Spec.spec
|
||||
Ascribed_Parameters_Spec.spec
|
||||
Asserts_Spec.spec
|
||||
Lazy_Spec.spec
|
||||
Runtime_Spec.spec
|
||||
Self_Type_Spec.spec
|
||||
|
27
test/Tests/src/Runtime/Asserts_Spec.enso
Normal file
27
test/Tests/src/Runtime/Asserts_Spec.enso
Normal file
@ -0,0 +1,27 @@
|
||||
from Standard.Base import all
|
||||
|
||||
from Standard.Base.Errors.Common import Assertion_Error
|
||||
|
||||
from Standard.Test import Test, Test_Suite
|
||||
import Standard.Test.Extensions
|
||||
|
||||
foreign js js_check = """
|
||||
return (4 == 2 + 2)
|
||||
|
||||
on_ci = if Environment.get "ENSO_RUNNER_CONTAINER_NAME" . is_nothing . not then Nothing else "Not in CI"
|
||||
|
||||
spec = Test.group "Asserts" pending=on_ci <|
|
||||
Test.specify "should be enabled on the CI" <|
|
||||
p = Panic.catch Assertion_Error (Runtime.assert False) err->
|
||||
err.payload
|
||||
Meta.type_of p . should_be_a Assertion_Error
|
||||
|
||||
Test.specify "should be able to take foreign functions as expressions" <|
|
||||
ret = Runtime.assert js_check
|
||||
ret . should_be_a Nothing
|
||||
|
||||
Test.specify "should be able to take lambdas as expressions" <|
|
||||
Runtime.assert <|
|
||||
4 == 2 + 2
|
||||
|
||||
main = Test_Suite.run_main spec
|
Loading…
Reference in New Issue
Block a user