Class: GitlabQuality::TestTooling::CodeCoverage::ClickHouse::CategoryOwnersTable

Inherits:
Table
  • Object
show all
Defined in:
lib/gitlab_quality/test_tooling/code_coverage/click_house/category_owners_table.rb

Constant Summary collapse

TABLE_NAME =
"category_owners"
MissingMappingError =
Class.new(StandardError)

Constants inherited from Table

Table::LOG_PREFIX

Instance Method Summary collapse

Methods inherited from Table

#initialize, #push

Constructor Details

This class inherits a constructor from GitlabQuality::TestTooling::CodeCoverage::ClickHouse::Table

Instance Method Details

#owners(feature_category_name) ⇒ Hash

Owners of particular feature category as group, stage and section

Parameters:

  • feature_category_name (String)

    the feature_category name

Returns:

  • (Hash)


26
27
28
29
30
# File 'lib/gitlab_quality/test_tooling/code_coverage/click_house/category_owners_table.rb', line 26

def owners(feature_category_name)
  records.fetch(feature_category_name)
rescue KeyError
  raise(MissingMappingError, "Feature category '#{feature_category_name}' not found in table '#{table_name}'")
end

#truncateObject



14
15
16
17
18
19
20
# File 'lib/gitlab_quality/test_tooling/code_coverage/click_house/category_owners_table.rb', line 14

def truncate
  logger.debug("#{LOG_PREFIX} Truncating table #{full_table_name} ...")

  client.query("TRUNCATE TABLE #{full_table_name}")

  logger.info("#{LOG_PREFIX} Successfully truncated table #{full_table_name}")
end