Skip to content

Instantly share code, notes, and snippets.

@graves
Last active September 28, 2016 23:35
Show Gist options
  • Save graves/3c653ad131829717eaf588daef217be4 to your computer and use it in GitHub Desktop.
Save graves/3c653ad131829717eaf588daef217be4 to your computer and use it in GitHub Desktop.
tds_test.exs test results at 0day Github release
❯❯❯ mix test test/tds_test.exs ✱ (git:ecto2)
test/test_helper.exs:46: warning: variable pid is unused
warning: using Ecto.Model is deprecated, please use Ecto.Schema instead
test/tds_test.exs:12: Tds.Ecto.TdsTest.Model (module)
warning: using Ecto.Model is deprecated, please use Ecto.Schema instead
test/tds_test.exs:30: Tds.Ecto.TdsTest.Model2 (module)
warning: using Ecto.Model is deprecated, please use Ecto.Schema instead
test/tds_test.exs:40: Tds.Ecto.TdsTest.Model3 (module)
Excluding tags: [:assigns_id_type, :array_type, :case_sensitive]
.......
1) test alter table with prefix (Tds.Ecto.TdsTest)
test/tds_test.exs:603
Assertion with == failed
code: SQL.execute_ddl(alter) == "ALTER TABLE [foo].[posts] ADD [title] nvarchar(100) NOT NULL ;\nIF (OBJECT_ID('DF_title', 'D') IS NOT NULL)\nBEGIN ALTER TABLE [posts]\nDROP CONSTRAINT DF_title END;\nALTER TABLE [posts] ADD CONSTRAINT DF_title DEFAULT N'Untitled' FOR [title];\nALTER TABLE [foo].[posts] ADD [author_id] bigint NULL\nCONSTRAINT [posts_author_id_fkey] FOREIGN KEY (author_id)\nREFERENCES [author]([id]) ;\nIF (OBJECT_ID('DF_author_id', 'D') IS NOT NULL)\nBEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_author_id END;\nALTER TABLE [foo].[posts] ALTER COLUMN [price] numeric(8,2) NULL ;\nIF (OBJECT_ID('DF_price', 'D') IS NOT NULL)\nBEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_price END;\nALTER TABLE [foo].[posts] ALTER COLUMN [cost] integer NOT NULL ;\nIF (OBJECT_ID('DF_cost', 'D') IS NOT NULL)\nBEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_cost END;\nALTER TABLE [posts] ADD CONSTRAINT DF_cost DEFAULT NULL FOR [cost];\nALTER TABLE [foo].[posts] ALTER COLUMN [permalink_id] bigint NOT NULL ;\nIF (OBJECT_ID('[posts_permalink_id_fkey]', 'F') IS NOT NULL) BEGIN\nALTER TABLE [posts] DROP CONSTRAINT [posts_permalink_id_fkey] END;\nALTER TABLE [posts] ADD CONSTRAINT [posts_permalink_id_fkey] FOREIGN KEY ([permalink_id])\nREFERENCES [permalinks]([id]) ;\nIF (OBJECT_ID('DF_permalink_id', 'D') IS NOT NULL)\nBEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_permalink_id END;\nALTER TABLE [foo].[posts] DROP COLUMN [summary]\n" |> remove_newlines
lhs: "ALTER TABLE [foo].[posts] ADD [title] nvarchar(100) NOT NULL CONSTRAINT DF_title DEFAULT N'Untitled'; ALTER TABLE [foo].[posts] ADD [author_id] bigint NULL CONSTRAINT [posts_author_id_fkey] FOREIGN KEY (author_id) REFERENCES [author]([id]); ALTER TABLE [foo].[posts] ALTER COLUMN [price] numeric(8,2) NULL ; IF (OBJECT_ID('DF_price', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_price END; ALTER TABLE [foo].[posts] ALTER COLUMN [cost] integer NOT NULL ; IF (OBJECT_ID('DF_cost', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_cost END; ALTER TABLE [posts] ADD FOR [cost]; ALTER TABLE [foo].[posts] ALTER COLUMN [permalink_id] bigint NOT NULL ; IF (OBJECT_ID('[posts_permalink_id_fkey]', 'F') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT [posts_permalink_id_fkey] END; ALTER TABLE [posts] ADD CONSTRAINT [posts_permalink_id_fkey] FOREIGN KEY ([permalink_id]) REFERENCES [permalinks]([id]) ; IF (OBJECT_ID('DF_permalink_id', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_permalink_id END; ALTER TABLE [foo].[posts] IF (OBJECT_ID('DF_summary', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_summary END; DROP COLUMN [summary]"
rhs: "ALTER TABLE [foo].[posts] ADD [title] nvarchar(100) NOT NULL ; IF (OBJECT_ID('DF_title', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_title END; ALTER TABLE [posts] ADD CONSTRAINT DF_title DEFAULT N'Untitled' FOR [title]; ALTER TABLE [foo].[posts] ADD [author_id] bigint NULL CONSTRAINT [posts_author_id_fkey] FOREIGN KEY (author_id) REFERENCES [author]([id]) ; IF (OBJECT_ID('DF_author_id', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_author_id END; ALTER TABLE [foo].[posts] ALTER COLUMN [price] numeric(8,2) NULL ; IF (OBJECT_ID('DF_price', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_price END; ALTER TABLE [foo].[posts] ALTER COLUMN [cost] integer NOT NULL ; IF (OBJECT_ID('DF_cost', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_cost END; ALTER TABLE [posts] ADD CONSTRAINT DF_cost DEFAULT NULL FOR [cost]; ALTER TABLE [foo].[posts] ALTER COLUMN [permalink_id] bigint NOT NULL ; IF (OBJECT_ID('[posts_permalink_id_fkey]', 'F') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT [posts_permalink_id_fkey] END; ALTER TABLE [posts] ADD CONSTRAINT [posts_permalink_id_fkey] FOREIGN KEY ([permalink_id]) REFERENCES [permalinks]([id]) ; IF (OBJECT_ID('DF_permalink_id', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_permalink_id END; ALTER TABLE [foo].[posts] DROP COLUMN [summary]"
stacktrace:
test/tds_test.exs:612
.......
2) test limit and offset (Tds.Ecto.TdsTest)
test/tds_test.exs:116
** (Ecto.QueryError) You must provide a limit while using an offset in query:
from m in Tds.Ecto.TdsTest.Model,
order_by: [asc: m.x],
offset: 5,
select: 0
stacktrace:
(tds_ecto) lib/tds_ecto/connection.ex:1050: Tds.Ecto.Connection.error!/2
(tds_ecto) lib/tds_ecto/connection.ex:281: Tds.Ecto.Connection.all/1
test/tds_test.exs:121
..
3) test create index with prefix (Tds.Ecto.TdsTest)
test/tds_test.exs:711
** (UndefinedFunctionError) undefined function nil.config/0
stacktrace:
nil.config()
(tds_ecto) Tds.Ecto.Connection.execute_ddl/2
test/tds_test.exs:713
4) test alter table with reference (Tds.Ecto.TdsTest)
test/tds_test.exs:641
Assertion with == failed
code: SQL.execute_ddl(alter) == "ALTER TABLE [posts] ADD [comment_id] bigint NULL CONSTRAINT [posts_comment_id_fkey] FOREIGN KEY (comment_id) REFERENCES [comments]([id]) ;\nIF (OBJECT_ID('DF_comment_id', 'D') IS NOT NULL)\nBEGIN\nALTER TABLE [posts] DROP CONSTRAINT DF_comment_id\nEND\n" |> remove_newlines
lhs: "ALTER TABLE [posts] ADD [comment_id] bigint NULL CONSTRAINT [posts_comment_id_fkey] FOREIGN KEY (comment_id) REFERENCES [comments]([id])"
rhs: "ALTER TABLE [posts] ADD [comment_id] bigint NULL CONSTRAINT [posts_comment_id_fkey] FOREIGN KEY (comment_id) REFERENCES [comments]([id]) ; IF (OBJECT_ID('DF_comment_id', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_comment_id END"
stacktrace:
test/tds_test.exs:645
..
5) test alter table (Tds.Ecto.TdsTest)
test/tds_test.exs:581
Assertion with == failed
code: SQL.execute_ddl(alter) == "ALTER TABLE [posts] ADD [title] nvarchar(100) NOT NULL ;\nIF (OBJECT_ID('DF_title', 'D') IS NOT NULL)\nBEGIN\nALTER TABLE [posts] DROP CONSTRAINT DF_title\nEND;\nALTER TABLE [posts] ADD CONSTRAINT DF_title DEFAULT N'Untitled' FOR [title];\nALTER TABLE [posts] ALTER COLUMN [price] numeric(8,2) NULL ;\nIF (OBJECT_ID('DF_price', 'D') IS NOT NULL)\nBEGIN\nALTER TABLE [posts] DROP CONSTRAINT DF_price\nEND;\nALTER TABLE [posts] DROP COLUMN [summary]\n" |> remove_newlines
lhs: "ALTER TABLE [posts] ADD [title] nvarchar(100) NOT NULL CONSTRAINT DF_title DEFAULT N'Untitled'; ALTER TABLE [posts] ALTER COLUMN [price] numeric(8,2) NULL ; IF (OBJECT_ID('DF_price', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_price END; ALTER TABLE [posts] IF (OBJECT_ID('DF_summary', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_summary END; DROP COLUMN [summary]"
rhs: "ALTER TABLE [posts] ADD [title] nvarchar(100) NOT NULL ; IF (OBJECT_ID('DF_title', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_title END; ALTER TABLE [posts] ADD CONSTRAINT DF_title DEFAULT N'Untitled' FOR [title]; ALTER TABLE [posts] ALTER COLUMN [price] numeric(8,2) NULL ; IF (OBJECT_ID('DF_price', 'D') IS NOT NULL) BEGIN ALTER TABLE [posts] DROP CONSTRAINT DF_price END; ALTER TABLE [posts] DROP COLUMN [summary]"
stacktrace:
test/tds_test.exs:587
....
6) test interpolated values (Tds.Ecto.TdsTest)
test/tds_test.exs:264
** (ArgumentError) expected a list of fields in `select/2` inside `select`, got: `0`
stacktrace:
(ecto) lib/ecto/query/builder/select.ex:120: Ecto.Query.Builder.Select.fields!/2
test/tds_test.exs:266
7) test update all (Tds.Ecto.TdsTest)
test/tds_test.exs:292
** (Ecto.QueryError) test/tds_test.exs:308: value `"123"` cannot be dumped to type :integer. Or the value is incompatible or it must be interpolated (using ^) so it may be cast accordingly in query:
from m in Tds.Ecto.TdsTest.Model,
update: [set: [x: 0, y: "123"]]
stacktrace:
(elixir) lib/enum.ex:1151: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir) lib/enum.ex:1151: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir) lib/enum.ex:1151: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
(elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
test/tds_test.exs:308
...........................
Finished in 1.3 seconds (1.3s on load, 0.02s on tests)
56 tests, 7 failures
Randomized with seed 906197
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment