mirror of
https://github.com/enso-org/enso.git
synced 2024-11-22 22:10:15 +03:00
Fix sporadic Table_Tests
failures caused by reliance on test ordering. (#9438)
* wip * 4 failures * fix * todo
This commit is contained in:
parent
515dacfec2
commit
bb080b54b6
@ -539,7 +539,7 @@ add_specs suite_builder setup =
|
||||
t2.should_fail_with Ambiguous_Column_Rename
|
||||
err = t2.catch
|
||||
err.column_name . should_equal "beta"
|
||||
err.new_names . should_equal ["FirstColumn", "DifferentName!"]
|
||||
err.new_names.sort . should_equal ["DifferentName!", "FirstColumn"]
|
||||
|
||||
group_builder.specify "should correctly handle edge-cases: aliased selectors" <|
|
||||
t = table_builder [["alpha", [1,2,3]], ["bet", [4,5,6]]]
|
||||
@ -587,7 +587,7 @@ add_specs suite_builder setup =
|
||||
group_builder.specify "should correctly handle problems: duplicate names" <|
|
||||
map = ["Test", "Test", "Test", "Test"]
|
||||
action = data.table.rename_columns map on_problems=_
|
||||
tester = expect_column_names ["Test 1", "Test 2", "Test 3", "Test"]
|
||||
tester = expect_column_names ["Test 1", "Test 2", "Test 3", "Test"] ignore_order=True
|
||||
problems = [Duplicate_Output_Column_Names.Error ["Test", "Test", "Test"]]
|
||||
Problems.test_problem_handling action problems tester
|
||||
|
||||
|
@ -7,8 +7,10 @@ import project.Common_Table_Operations.Main.Test_Setup
|
||||
import project.Common_Table_Operations.Main.Test_Selection
|
||||
import project.Common_Table_Operations.Aggregate_Spec
|
||||
|
||||
expect_column_names names table =
|
||||
table.columns . map .name . should_equal names frames_to_skip=2
|
||||
expect_column_names names table ignore_order=False =
|
||||
case ignore_order of
|
||||
False -> table.columns . map .name . should_equal names frames_to_skip=2
|
||||
True -> table.columns . map .name . sort . should_equal names.sort frames_to_skip=2
|
||||
|
||||
type Dummy_Connection
|
||||
Value
|
||||
|
@ -394,6 +394,9 @@ type File_Connection
|
||||
|
||||
add_specs suite_builder =
|
||||
in_file_prefix = "[SQLite File] "
|
||||
# TODO: Add a suite-level teardown to delete this file at the end.
|
||||
# https://github.com/enso-org/enso/issues/9436
|
||||
# https://github.com/enso-org/enso/issues/9437
|
||||
database_file = Database_File.create
|
||||
|
||||
sqlite_spec suite_builder in_file_prefix (_ -> create_file_connection database_file.file)
|
||||
@ -410,9 +413,6 @@ add_specs suite_builder =
|
||||
suite_builder.group "SQLite_Format should allow connecting to SQLite files" group_builder->
|
||||
data = File_Connection.setup database_file
|
||||
|
||||
group_builder.teardown <|
|
||||
data.teardown
|
||||
|
||||
group_builder.specify "should recognise a SQLite database file" <|
|
||||
Auto_Detect.get_reading_format data.file . should_be_a SQLite_Format
|
||||
|
||||
@ -442,7 +442,7 @@ add_specs suite_builder =
|
||||
group_builder.specify "should connect to a db file" <|
|
||||
connection = Data.read data.file
|
||||
tables = connection.tables
|
||||
tables.row_count . should_not_equal 0
|
||||
tables.row_count . should_be_a Integer
|
||||
connection.close
|
||||
|
||||
group_builder.specify 'should not duplicate warnings' <|
|
||||
|
Loading…
Reference in New Issue
Block a user