Project

General

Profile

Bug #13355

facet_test table missing causes test failures in plugins

Added by Tom Caspy almost 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Related issues

Related to Foreman - Feature #13216: Add API extensions for facetsClosed2016-01-14

Associated revisions

Revision 7e670d3f (diff)
Added by Tom Caspy almost 4 years ago

fixes #13355 - facet test tables get created when tests run

moving the require to the test helper ensures that the code gets
evaluated before Spork.prefork, thus, the tables get created.

History

#1 Updated by Dominic Cleal almost 4 years ago

  • Category set to Tests

Can you please provide any more information?

#3 Updated by Dominic Cleal almost 4 years ago

#4 Updated by Dominic Cleal almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 71
10:54:29 FacetTest::namespaced facets#test_0001_can create a namespaced facet = 0.01 s = E
10:54:29 FacetTest::namespaced facets#test_0002_returns facets attributes = 0.01 s = E
10:54:29 FacetTest::managed host behavior#test_0001_registered facets are subscribed properly = 0.01 s = E
10:54:29 FacetTest::managed host behavior#test_0002_facets are cloned to the new host = 0.01 s = E
10:54:29 FacetTest::managed host behavior#test_0003_facets are included in attributes = 0.01 s = E

11:04:12   1) Error:
11:04:12 FacetTest::namespaced facets#test_0001_can create a namespaced facet:
11:04:12 ActiveRecord::StatementInvalid: Mysql2::Error: Table 'test_plugin_matrix-3-test.module_test_facets' doesn't exist: SHOW FULL FIELDS FROM `module_test_facets`
11:04:12     test/unit/facet_test.rb:29:in `block (2 levels) in <class:FacetTest>'
11:04:12 
11:04:12 
11:04:12   2) Error:
11:04:12 FacetTest::namespaced facets#test_0002_returns facets attributes:
11:04:12 ActiveRecord::StatementInvalid: Mysql2::Error: Table 'test_plugin_matrix-3-test.module_test_facets' doesn't exist: SHOW FULL FIELDS FROM `module_test_facets`
11:04:12     test/unit/facet_test.rb:29:in `block (2 levels) in <class:FacetTest>'
11:04:12 
11:04:12 
11:04:12   3) Error:
11:04:12 FacetTest::managed host behavior#test_0001_registered facets are subscribed properly:
11:04:12 ActiveRecord::StatementInvalid: Mysql2::Error: Table 'test_plugin_matrix-3-test.test_facets' doesn't exist: SHOW FULL FIELDS FROM `test_facets`
11:04:12     test/unit/facet_test.rb:48:in `block (2 levels) in <class:FacetTest>'
11:04:12 
11:04:12 
11:04:12   4) Error:
11:04:12 FacetTest::managed host behavior#test_0002_facets are cloned to the new host:
11:04:12 ActiveRecord::StatementInvalid: Mysql2::Error: Table 'test_plugin_matrix-3-test.test_facets' doesn't exist: SHOW FULL FIELDS FROM `test_facets`
11:04:12     test/unit/facet_test.rb:48:in `block (2 levels) in <class:FacetTest>'
11:04:12 
11:04:12 
11:04:12   5) Error:
11:04:12 FacetTest::managed host behavior#test_0003_facets are included in attributes:
11:04:12 ActiveRecord::StatementInvalid: Mysql2::Error: Table 'test_plugin_matrix-3-test.test_facets' doesn't exist: SHOW FULL FIELDS FROM `test_facets`
11:04:12     test/unit/facet_test.rb:48:in `block (2 levels) in <class:FacetTest>'
11:04:12 
11:04:12 3359 runs, 7785 assertions, 0 failures, 5 errors, 0 skips

#5 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Tom Caspy
  • Pull request https://github.com/theforeman/foreman/pull/3118 added

#6 Updated by Tom Caspy almost 4 years ago

the issue is caused because the code which creates the tables is evaluated in the middle of test runs, after Sport.prefork block has run. moving the require into the test helper allows the code to run. this issue should be 100% reproducible in the CI, and on dev machines will happen with a new test database.

#7 Updated by Tom Caspy almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF