Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Table_Tests to the builder API #8622

Merged
merged 98 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
0ca0e48
Skeleton of Test_New builder API
Akirathan Dec 21, 2023
1d6cdba
Add Test_New standard library.
Akirathan Dec 22, 2023
f31fd10
Copy some stuff from Test to Test_New
Akirathan Dec 22, 2023
0e00586
Test_New accepts filters
Akirathan Dec 22, 2023
b2da2ce
Add Proposition_1.enso prototype
Akirathan Dec 27, 2023
c72967f
Revert "Test_New accepts filters"
Akirathan Dec 27, 2023
987efb6
Fix imports in Proposition (2) and add some prints
Akirathan Dec 27, 2023
38d85ff
Rename Test_New.enso to Test.enso
Akirathan Dec 29, 2023
268234f
Refactor Test_New/Test to multiple source files
Akirathan Dec 29, 2023
b55b595
Implement Suite.merge, add prototype of Test/Main_New.enso
Akirathan Dec 29, 2023
4255c94
Initial version of SQLite_Spec migration
Akirathan Jan 5, 2024
9e0a498
Move Suite.build to Test.build
Akirathan Jan 5, 2024
c65efc3
Split Test_Result into Spec_Result
Akirathan Jan 8, 2024
7a749ed
Move test running logic into Helpers module
Akirathan Jan 8, 2024
40a2873
Add Test_Reporter from Test lib
Akirathan Jan 8, 2024
2ef29f2
Group and Spec can be pending
Akirathan Jan 8, 2024
22bc28f
Add Suite.run_with_filter
Akirathan Jan 8, 2024
4e5fced
Merge branch 'develop' into wip/akirathan/7566-stdlib-test-builder-api
Akirathan Jan 9, 2024
5b961c4
Introduce group_with_setup and specify_with_args methods to the API.
Akirathan Jan 9, 2024
25fbe49
Remove group_with_setup and specify_with_args and replace it with tea…
Akirathan Jan 10, 2024
4795e18
Remove Proposition_1.enso
Akirathan Jan 10, 2024
29baa8e
Default_Ordering_Spec_New gets connection_provider instead of connect…
Akirathan Jan 11, 2024
aae5c6c
teardown is not called if the group is empty
Akirathan Jan 11, 2024
75842f0
Copy Problems from Test into Test_New
Akirathan Jan 11, 2024
61a8acc
Removed the bugged assertion
Akirathan Jan 12, 2024
99ce849
Run only the failing test
Akirathan Jan 12, 2024
172eaf9
Add Common_Spec_New
Akirathan Jan 12, 2024
8c0fe40
Merge branch 'develop' into wip/akirathan/7566-stdlib-test-builder-api
Akirathan Jan 16, 2024
a9cf3ee
Integrate simpler lazy field initialization.
Akirathan Jan 16, 2024
5b51c65
Replace Default_Ordering_Spec
Akirathan Jan 16, 2024
eeaa5d2
Replace Common_Spec with the builder API
Akirathan Jan 16, 2024
b25ea2c
Group can be pending
Akirathan Jan 16, 2024
80375e8
Refactor bunch of Table_Test files to the new builder API
Akirathan Jan 17, 2024
d152c22
Remove SQLite_Spec_New
Akirathan Jan 17, 2024
ce8df7b
Fix JUnit xml output
Akirathan Jan 17, 2024
02e22cb
Fix Upload_Spec
Akirathan Jan 17, 2024
9f0da9d
Copy more sources from Test into Test_New
Akirathan Jan 18, 2024
a0a0a3a
Fix some typos causing runtime errors
Akirathan Jan 18, 2024
8789d7b
Test_Setup.Config.table_builder accepts connection parameter.
Akirathan Jan 18, 2024
43b22a0
Implement Util.run_default_backend
Akirathan Jan 18, 2024
602d382
Fix Date_Time_Spec
Akirathan Jan 18, 2024
1946e30
Add main method to some tests.
Akirathan Jan 18, 2024
9ccbdc0
Fix Missing_Values_Spec
Akirathan Jan 18, 2024
3ae3a7f
Fix Order_By_Spec
Akirathan Jan 18, 2024
4a6afef
Fix Select_Columns_Spec
Akirathan Jan 18, 2024
b152643
Fix Take_Drop_Spec
Akirathan Jan 18, 2024
a07754d
Add some more main methods to tests
Akirathan Jan 18, 2024
bc4ba75
Use the same connection for table_builder in Integration_Tests
Akirathan Jan 18, 2024
af23b65
Fix setup in Core_Spec
Akirathan Jan 18, 2024
10d1f3e
Fix setup in Upload_Spec
Akirathan Jan 18, 2024
3076078
Fix setup in Union_Spec
Akirathan Jan 18, 2024
25662a4
Fix setup in Lookup_Spec
Akirathan Jan 18, 2024
ddb97e2
Fix some typos
Akirathan Jan 18, 2024
45be065
Fix typos in SQLite_Spec
Akirathan Jan 18, 2024
9574b3a
Remove Bool_Spec_New from Base_Test
Akirathan Jan 18, 2024
6b42315
Refactor Table_Tests/src/Helpers to Test_New
Akirathan Jan 18, 2024
a16aa29
Refactor Table_Tests/src/In_Memory to Test_New
Akirathan Jan 19, 2024
12b6ae4
Remove unused Table_Tests/src/In_Memory/Common_Spec
Akirathan Jan 19, 2024
348af3f
WIP: Fix "Keys are not Text" test
Akirathan Jan 19, 2024
5e3114e
Refactor Table_Tests/src/IO to Test_New
Akirathan Jan 19, 2024
2f28af4
Refactor Table_Tests/src/Formatting to Test_New
Akirathan Jan 19, 2024
110abff
Refactor Codegen_Spec to the new API
Akirathan Jan 19, 2024
ca65fe4
Add some teardowns.
Akirathan Jan 22, 2024
666b1f7
Refactor Postgres tests to Test_New
Akirathan Jan 22, 2024
9955e63
Add teardowns to Column_Operations_Spec
Akirathan Jan 22, 2024
d85b138
Enable some temporary disabled tests
Akirathan Jan 22, 2024
f4906ba
Fix teardowns in Aggregate_Spec
Akirathan Jan 22, 2024
bd676f9
Add more teardowns.
Akirathan Jan 23, 2024
32ac4e8
Add docs how to run Postgres in Docker for testing
Akirathan Jan 23, 2024
9864a5a
Fix typo in Integration_Tests
Akirathan Jan 23, 2024
602fb47
Refactor Redshift tests to Test_New
Akirathan Jan 23, 2024
14fa1bc
Fix typos
Akirathan Jan 23, 2024
0e85566
Merge branch 'develop' into wip/akirathan/7566-stdlib-test-builder-api
Akirathan Jan 23, 2024
0b9d063
Remove empty file
Akirathan Jan 23, 2024
37ed88e
Remove Phases from Test_New
Akirathan Jan 23, 2024
5ea134a
Add docs to Test_New
Akirathan Jan 23, 2024
7bc400b
Add docs to Test_New
Akirathan Jan 23, 2024
587b287
Remove Suite.run_all method
Akirathan Jan 23, 2024
cffdad3
Filter can be either Regex, Text, or Nothing
Akirathan Jan 23, 2024
0a7a527
Print test stats at the end of the run
Akirathan Jan 23, 2024
ef3a408
Refactor Table_Tests/src/Main.enso to Test_New
Akirathan Jan 23, 2024
357b084
Implement `add_specs` method in all Main.enso files.
Akirathan Jan 23, 2024
6b50c3d
Remove temporary printing
Akirathan Jan 23, 2024
54c216f
Set ENSO_TEST_ANSI_COLORS to true when running enso tests
Akirathan Jan 23, 2024
84c2f61
Add In_Memory/Common_Spec
Akirathan Jan 24, 2024
e69f50b
Fix teardowns in Common_Table_Operations/Join
Akirathan Jan 24, 2024
06be31e
Merge Test/Extensions into Test_New/Extensions
Akirathan Jan 24, 2024
bb18f42
Remove temporary printing
Akirathan Jan 24, 2024
0935ba7
Merge branch 'develop' into wip/akirathan/7566-stdlib-test-builder-api
Akirathan Jan 25, 2024
390e7e3
Refactor Nothing_Spec to Test_New after merge
Akirathan Jan 25, 2024
b1e45d3
Fix cargo lint
Akirathan Jan 25, 2024
d8af7ea
Refactor Base_Tests/Numbers_Spec to Test_New
Akirathan Jan 25, 2024
774ccbf
In_Memory/Main includes specs from In_Memory/Common_Spec
Akirathan Jan 25, 2024
9b2b4e7
Run both old and new tests in Base_Tests/Main.enso
Akirathan Jan 25, 2024
305f024
Add should_exit parameter to Suite.run_with_filter
Akirathan Jan 25, 2024
6496a86
Fix some typos
Akirathan Jan 25, 2024
b650a6b
Merge branch 'develop' into wip/akirathan/7566-stdlib-test-builder-api
mergify[bot] Jan 26, 2024
31a340a
fmt
Akirathan Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build/build/src/enso.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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::paths::ENSO_TEST_ANSI_COLORS;
use crate::postgres;
use crate::postgres::EndpointConfiguration;
use crate::postgres::Postgresql;
Expand Down Expand Up @@ -121,6 +122,7 @@ impl BuiltEnso {
ENSO_META_TEST_ARGS.set(&format!("{} --run", ir_caches.flag()))?;

ENSO_ENABLE_ASSERTIONS.set("true")?;
ENSO_TEST_ANSI_COLORS.set("true")?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just makes the output of the tests more colorful. Like so:
image
(Inspired by the output from ScalaTest framework)


// Prepare Engine Test Environment
if let Ok(gdoc_key) = std::env::var("GDOC_KEY") {
Expand Down
3 changes: 3 additions & 0 deletions build/build/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ ide_ci::define_env_var! {
/// If Enso-specific assertions should be enabled.
ENSO_ENABLE_ASSERTIONS, String;

/// If true, enso tests output will be colored.
ENSO_TEST_ANSI_COLORS, String;

/// Can be set to `"espresso"` to enable Espresso interpreter support.
ENSO_JAVA, String;
}
Expand Down
10 changes: 10 additions & 0 deletions distribution/lib/Standard/Test_New/0.0.0-dev/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Test_New
namespace: Standard
version: 0.0.0-dev
license: APLv2
authors:
- name: Enso Team
email: [email protected]
maintainers:
- name: Enso Team
email: [email protected]
11 changes: 11 additions & 0 deletions distribution/lib/Standard/Test_New/0.0.0-dev/src/Clue.enso
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
private

## PRIVATE
type Clue
## PRIVATE

Represents a clue as to why a test failed

Arguments:
- add_clue: either Nothing or a function which modifies a failure message
Value add_clue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from Standard.Base import all
import Standard.Base.Runtime.Context

import project.Test.Test

## PRIVATE
Runs the action twice, once with the Output context enabled and once with it
disabled, to check that the behaviour is the same regardless of context.
run_with_and_without_output ~action =
Context.Output.with_enabled <|
Test.with_clue "(normal mode - Output context enabled) " <|
action
Context.Output.with_disabled <|
Test.with_clue "(dry run - Output context disabled) " <|
action
Loading
Loading