-
Notifications
You must be signed in to change notification settings - Fork 28
Make Scenic Integration Optional #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Make Scenic Integration Optional #124
Conversation
murrayju
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the submission! Just a bit of feedback, if you don't mind addressing it.
|
@murrayju Please note that I also bumped some tool versions to ensure that the project is up to date when running the tests locally. For what it's worth, to get all the tests running locally, I had to make some changes to some surrounding code. I haven't committed it yet but it may be worth it to get it included. Specifically the test helper diff --git a/lib/timescaledb/continuous_aggregates.rb b/lib/timescaledb/continuous_aggregates.rb
index 5c4e61f..85d4293 100644
--- a/lib/timescaledb/continuous_aggregates.rb
+++ b/lib/timescaledb/continuous_aggregates.rb
@@ -3,11 +3,15 @@ module Timescaledb
self.table_name = "timescaledb_information.continuous_aggregates"
self.primary_key = 'materialization_hypertable_name'
- has_many :jobs, foreign_key: "hypertable_name",
- class_name: "Timescaledb::Job"
+ has_many :jobs,
+ foreign_key: "hypertable_name",
+ primary_key: "view_name",
+ class_name: "Timescaledb::Job"
- has_many :chunks, foreign_key: "hypertable_name",
- class_name: "Timescaledb::Chunk"
+ has_many :chunks,
+ foreign_key: "hypertable_name",
+ primary_key: "materialization_hypertable_name",
+ class_name: "Timescaledb::Chunk"
scope :resume, -> do
{
diff --git a/spec/support/active_record/schema.rb b/spec/support/active_record/schema.rb
index 6924962..b0a2a91 100644
--- a/spec/support/active_record/schema.rb
+++ b/spec/support/active_record/schema.rb
@@ -36,6 +36,10 @@ def setup_tables
end
def teardown_tables
+ Timescaledb::ContinuousAggregates.all.each do |continuous_aggregate|
+ ActiveRecord::Base.connection.execute("DROP MATERIALIZED VIEW IF EXISTS #{continuous_aggregate.view_name} CASCADE")
+ end
+
ActiveRecord::Base.connection.tables.each do |table|
ActiveRecord::Base.connection.drop_table(table, force: :cascade)
end |
|
@calmacleod lets get the tests to pass in this PR. Please add your fixes |
|
@murrayju The PR has been updated with the following:
|
|
Thanks @calmacleod. It looks like the tests are still failing in the checks here. Can you take another look? |
|
@murrayju I've made some changes that should hopefully fix those CI failures - The workflow needs maintainer approval before it can run however. |
|
@murrayju There's some weird, potentially inconsistent, between local and CI testing. This is the test failure I'm getting: Initially I dealt with the same failure locally, however, I was able to get the test passing by modifying This is because the cAgg refresh policy job gets created with the table name of the cAgg rather than the table name of the hyper table for which the cAgg is being created for. The databases which we're testing against in CR are all 12m old images where as I'm using Timescale on PG18 to test locally, perhaps the structure between cAggs and Jobs have changed in newer versions? The cAgg create by the test:
And the refresh policy job created for the cAgg:
|
Resolve Scenic Integration Causes Issues with Multiple Databases by adding optional configuration block with option to disable Scenic integration