mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 01:31:39 -05:00
Update changelog and add a spec
This commit is contained in:
parent
551c6e7629
commit
48eb55f621
6 changed files with 38 additions and 20 deletions
21
CHANGELOG.md
21
CHANGELOG.md
|
|
@ -14,6 +14,27 @@ Moving to SolidQueue and SolidCache will require creating new SQLite databases,
|
||||||
|
|
||||||
Background jobs interface is now available at `/jobs` page.
|
Background jobs interface is now available at `/jobs` page.
|
||||||
|
|
||||||
|
Please, update your `docker-compose.yml` and add the following:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
dawarich_app:
|
||||||
|
image: freikin/dawarich:latest
|
||||||
|
container_name: dawarich_app
|
||||||
|
volumes:
|
||||||
|
- dawarich_public:/var/app/public
|
||||||
|
- dawarich_watched:/var/app/tmp/imports/watched
|
||||||
|
- dawarich_storage:/var/app/storage
|
||||||
|
+ - dawarich_db_data:/dawarich_db_data
|
||||||
|
...
|
||||||
|
environment:
|
||||||
|
...
|
||||||
|
DATABASE_NAME: dawarich_development
|
||||||
|
# SQLite database paths for secondary databases
|
||||||
|
+ QUEUE_DATABASE_PATH: /dawarich_db_data/dawarich_development_queue.sqlite3
|
||||||
|
+ CACHE_DATABASE_PATH: /dawarich_db_data/dawarich_development_cache.sqlite3
|
||||||
|
+ CABLE_DATABASE_PATH: /dawarich_db_data/dawarich_development_cable.sqlite3
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
|
|
|
||||||
2
Gemfile
2
Gemfile
|
|
@ -23,7 +23,6 @@ gem 'lograge'
|
||||||
gem 'mission_control-jobs'
|
gem 'mission_control-jobs'
|
||||||
gem 'oj'
|
gem 'oj'
|
||||||
gem 'pg'
|
gem 'pg'
|
||||||
gem 'sqlite3', '~> 2.6'
|
|
||||||
gem 'prometheus_exporter'
|
gem 'prometheus_exporter'
|
||||||
gem 'activerecord-postgis-adapter'
|
gem 'activerecord-postgis-adapter'
|
||||||
gem 'puma'
|
gem 'puma'
|
||||||
|
|
@ -37,6 +36,7 @@ gem 'rswag-api'
|
||||||
gem 'rswag-ui'
|
gem 'rswag-ui'
|
||||||
gem 'sentry-ruby'
|
gem 'sentry-ruby'
|
||||||
gem 'sentry-rails'
|
gem 'sentry-rails'
|
||||||
|
gem 'sqlite3', '~> 2.6'
|
||||||
gem 'stackprof'
|
gem 'stackprof'
|
||||||
gem 'sidekiq'
|
gem 'sidekiq'
|
||||||
gem 'sidekiq-cron'
|
gem 'sidekiq-cron'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
# not a terminal started via bin/rails console! Add "console" to any action or any ERB template view
|
# not a terminal started via bin/rails console! Add "console" to any action or any ERB template view
|
||||||
# to make the web console appear.
|
# to make the web console appear.
|
||||||
|
|
||||||
development:
|
default: &default
|
||||||
adapter: solid_cable
|
adapter: solid_cable
|
||||||
connects_to:
|
connects_to:
|
||||||
database:
|
database:
|
||||||
|
|
@ -11,13 +11,11 @@ development:
|
||||||
polling_interval: 0.1.seconds
|
polling_interval: 0.1.seconds
|
||||||
message_retention: 1.day
|
message_retention: 1.day
|
||||||
|
|
||||||
|
development:
|
||||||
|
<<: *default
|
||||||
|
|
||||||
test:
|
test:
|
||||||
adapter: test
|
adapter: test
|
||||||
|
|
||||||
production:
|
production:
|
||||||
adapter: solid_cable
|
<<: *default
|
||||||
connects_to:
|
|
||||||
database:
|
|
||||||
writing: cable
|
|
||||||
polling_interval: 0.1.seconds
|
|
||||||
message_retention: 1.day
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
# Configure SolidCache
|
|
||||||
Rails.application.config.to_prepare do
|
|
||||||
# Only require the entries file as it seems the Entry class is defined there
|
|
||||||
begin
|
|
||||||
require 'solid_cache/store/entries'
|
|
||||||
rescue LoadError => e
|
|
||||||
Rails.logger.warn "Could not load SolidCache: #{e.message}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
@ -5,5 +5,11 @@ FactoryBot.define do
|
||||||
user
|
user
|
||||||
name { 'owntracks_export.json' }
|
name { 'owntracks_export.json' }
|
||||||
source { Import.sources[:owntracks] }
|
source { Import.sources[:owntracks] }
|
||||||
|
|
||||||
|
trait :with_points do
|
||||||
|
after(:create) do |import|
|
||||||
|
create_list(:point, 10, import:)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,17 @@ require 'rails_helper'
|
||||||
RSpec.describe Imports::Destroy do
|
RSpec.describe Imports::Destroy do
|
||||||
describe '#call' do
|
describe '#call' do
|
||||||
let!(:user) { create(:user) }
|
let!(:user) { create(:user) }
|
||||||
let!(:import) { create(:import, user: user) }
|
let!(:import) { create(:import, :with_points, user: user) }
|
||||||
let(:service) { described_class.new(user, import) }
|
let(:service) { described_class.new(user, import) }
|
||||||
|
|
||||||
it 'destroys the import' do
|
it 'destroys the import' do
|
||||||
expect { service.call }.to change { Import.count }.by(-1)
|
expect { service.call }.to change { Import.count }.by(-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'destroys the points' do
|
||||||
|
expect { service.call }.to change { Point.count }.by(-import.points.count)
|
||||||
|
end
|
||||||
|
|
||||||
it 'enqueues a BulkStatsCalculatingJob' do
|
it 'enqueues a BulkStatsCalculatingJob' do
|
||||||
expect(Stats::BulkCalculator).to receive(:new).with(user.id).and_return(double(call: nil))
|
expect(Stats::BulkCalculator).to receive(:new).with(user.id).and_return(double(call: nil))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue