Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.10 KB | None | 0 0
  1. ❯❯❯ mix test test/tds_test.exs ✱ (git:ecto2)
  2. test/test_helper.exs:46: warning: variable pid is unused
  3. warning: using Ecto.Model is deprecated, please use Ecto.Schema instead
  4. test/tds_test.exs:12: Tds.Ecto.TdsTest.Model (module)
  5. warning: using Ecto.Model is deprecated, please use Ecto.Schema instead
  6. test/tds_test.exs:30: Tds.Ecto.TdsTest.Model2 (module)
  7. warning: using Ecto.Model is deprecated, please use Ecto.Schema instead
  8. test/tds_test.exs:40: Tds.Ecto.TdsTest.Model3 (module)
  9. Excluding tags: [:assigns_id_type, :array_type, :case_sensitive]
  10.  
  11. .......
  12.  
  13. 1) test alter table with prefix (Tds.Ecto.TdsTest)
  14. test/tds_test.exs:603
  15. Assertion with == failed
  16. 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
  17. 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]"
  18. 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]"
  19. stacktrace:
  20. test/tds_test.exs:612
  21.  
  22. .......
  23.  
  24. 2) test limit and offset (Tds.Ecto.TdsTest)
  25. test/tds_test.exs:116
  26. ** (Ecto.QueryError) You must provide a limit while using an offset in query:
  27.  
  28. from m in Tds.Ecto.TdsTest.Model,
  29. order_by: [asc: m.x],
  30. offset: 5,
  31. select: 0
  32.  
  33. stacktrace:
  34. (tds_ecto) lib/tds_ecto/connection.ex:1050: Tds.Ecto.Connection.error!/2
  35. (tds_ecto) lib/tds_ecto/connection.ex:281: Tds.Ecto.Connection.all/1
  36. test/tds_test.exs:121
  37.  
  38. ..
  39.  
  40. 3) test create index with prefix (Tds.Ecto.TdsTest)
  41. test/tds_test.exs:711
  42. ** (UndefinedFunctionError) undefined function nil.config/0
  43. stacktrace:
  44. nil.config()
  45. (tds_ecto) Tds.Ecto.Connection.execute_ddl/2
  46. test/tds_test.exs:713
  47.  
  48.  
  49.  
  50. 4) test alter table with reference (Tds.Ecto.TdsTest)
  51. test/tds_test.exs:641
  52. Assertion with == failed
  53. 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
  54. lhs: "ALTER TABLE [posts] ADD [comment_id] bigint NULL CONSTRAINT [posts_comment_id_fkey] FOREIGN KEY (comment_id) REFERENCES [comments]([id])"
  55. 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"
  56. stacktrace:
  57. test/tds_test.exs:645
  58.  
  59. ..
  60.  
  61. 5) test alter table (Tds.Ecto.TdsTest)
  62. test/tds_test.exs:581
  63. Assertion with == failed
  64. 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
  65. 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]"
  66. 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]"
  67. stacktrace:
  68. test/tds_test.exs:587
  69.  
  70. ....
  71.  
  72. 6) test interpolated values (Tds.Ecto.TdsTest)
  73. test/tds_test.exs:264
  74. ** (ArgumentError) expected a list of fields in `select/2` inside `select`, got: `0`
  75. stacktrace:
  76. (ecto) lib/ecto/query/builder/select.ex:120: Ecto.Query.Builder.Select.fields!/2
  77. test/tds_test.exs:266
  78.  
  79.  
  80.  
  81. 7) test update all (Tds.Ecto.TdsTest)
  82. test/tds_test.exs:292
  83. ** (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:
  84.  
  85. from m in Tds.Ecto.TdsTest.Model,
  86. update: [set: [x: 0, y: "123"]]
  87.  
  88. stacktrace:
  89. (elixir) lib/enum.ex:1151: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
  90. (elixir) lib/enum.ex:1151: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
  91. (elixir) lib/enum.ex:1151: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
  92. (elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
  93. (elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
  94. test/tds_test.exs:308
  95.  
  96. ...........................
  97.  
  98. Finished in 1.3 seconds (1.3s on load, 0.02s on tests)
  99. 56 tests, 7 failures
  100.  
  101. Randomized with seed 906197
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement