Commit Graph

32 Commits (1d85b95a483301cd51a2fdfd4016bd6cdf20573b)

Author SHA1 Message Date
Rick Carlino 1d85b95a48 Unit tests for AutoSyncChannel.terminate 2020-03-09 11:48:07 -05:00
Rick Carlino 5ef5bb7b91 Silence supervisor crash reports in test suite 2020-03-09 10:59:37 -05:00
Rick Carlino 1f26485f88 Add `LOG_SILENCE` env for local dev, remove less helpful debug/warn logs (Elixir kind, not FarmBot kind) 2020-03-06 10:30:04 -06:00
Connor Rigby 847ec9d50b Remove sensitive process flag
This doesn't really do anything since `lagger` ignores this
flag anyway
2019-12-17 15:04:45 -08:00
Connor Rigby ec56ebaf74 Add telemetry to the rest of the app
More things will be added in the future.
Metrics are collected from bot state because
the amount of messages sent by every bot would
make datadog charge us a lot of money
2019-10-31 14:00:08 -07:00
Connor Rigby d3e51996b0 Add new resource: PointGroup 2019-10-22 14:19:32 -07:00
connor rigby c03e62bdfe Add "really fast blink" for syncing led 2019-09-17 12:22:36 -07:00
Connor Rigby 21ca8969a6
Remove sensor_readings from auto sync 2019-09-13 16:03:34 -07:00
Connor Rigby 01c3723877
Fix LEDs and Pinbindings working intermitently
The Internal pullups need to be disabled for the
FarmBot gpio hat to work properly
2019-09-13 16:03:29 -07:00
connor rigby e199cb8a90
Add LED handler for green (sync status) 2019-09-13 16:03:29 -07:00
gabrielburnworth ab1b8bbda5
add farmware execution rpc debug logs
Fix AMQP and network disconnects causing limbo state
2019-09-13 16:03:27 -07:00
Connor Rigby 60b075cf88
Normalize asset commans
Many clauses were not getting hit depending on if
`update/3` was called with a Module or a "String".
This normalizes everything early.
2019-09-13 16:03:23 -07:00
Connor Rigby e7ea334ab2
Change Preloading and Caching to use the same system as auto_sync
* preloader and reconciler no longer use a transaction
   * This will prevent rolling back a failed sync, but allows farmbot to
   continue operating if a sync does fail
* usage of the preloader updated to reflect this
2019-09-13 16:03:23 -07:00
Connor Rigby 890aac46db
Add asset commands for syncing SensorValues
* New Asset.Command for SensorValue
* new/update/delete for SensorValue
2019-09-13 16:03:22 -07:00
Connor Rigby d5215b6608
Handle unknown auto_sync messages
Adds a blacklist of known asset types that FarmBot can
handle and sync/cache. This is important for when new assets are added or
assets are dispatched for the frontend to consume.
2019-09-13 16:03:22 -07:00
Connor Rigby eefdbfc883
Further refactor Preloader to allow for error recovery
Previous system would crash the calling processes with a `MatchError`
instead of returning an error. The end result after this commit is
still the same - the auto_sync channel will attempt a resync
every 5 seconds. The log messages/user experience should just
be better now.
2019-09-13 16:03:22 -07:00
Connor Rigby 9a16c79ee8
Implement error handling for api 429 errors
* Changes auto_sync_channel to no longer use `handle_continue`
  * If preloading fails, retry instead of crashing.
* Make `get_changeset` return an error rather than raising an exception
  * Update every use of that function to handle posibility of error
2019-09-13 16:03:22 -07:00
Connor Rigby 7cda16f144
Fix argument order in auto_sync channel 2019-09-13 16:03:22 -07:00
Rick Carlino b619cb3576
Add scafold tests for celery_script_channel
* Test case: `celery_script_channel` `start_link`
2019-09-13 16:03:22 -07:00
Connor Rigby 26578a7ae2
Update `mox` to be used correctly.
I previously misunderstood how the black magic of mox actually works.
This updates `farmbot_ext` to not require setting excess data in every
config.exs entry. Also removes calls to `Application.get_env/2`
2019-09-13 16:03:22 -07:00
Connor Rigby 1483a3881f
Cleanup farmbot_ext auto_sync_channel
Also add some documentation for stubable
modules Query and Command
2019-09-13 16:03:21 -07:00
Rick Carlino ab9e434da8
Cleanup of auto_sync tests
* Move EagerLoader and friends back into AutoSyncChannel to avoid cross cutting
2019-09-13 16:03:21 -07:00
Rick Carlino c3819359b0
Test auto_sync ignore case
* Test case: auto_sync is disabled.

* Test case: auto_sync of Device assets

* Test case: auto_sync of FbosConfig

* Test case: auto_sync of FbosConfig assets

* Test case: auto_sync of FarmwareInstallation assets

Test case: `cache_sync/3`
2019-09-13 16:03:21 -07:00
Connor Rigby 1ec7e429bb
Set sync status to synced after any auto sync handler 2019-09-13 16:03:21 -07:00
Connor Rigby 5ef96a8db3
Update sync_status after preload in auto_sync channel 2019-09-13 16:03:21 -07:00
Rick Carlino 8c7d6f6608
AutoSyncChannel Testing: Device, `auto_sync = false` (#714)
* Test auto_sync ignore case

* Test case: auto_sync is disabled.

* Test for auto_sync of Device assets
2019-09-13 16:03:21 -07:00
Rick Carlino 4248c93962
Add mox and excoveralls
* and tests for AutoSyncChannel
* add tests for auto sync preloader
2019-09-13 16:03:20 -07:00
Rick Carlino 0c75d61d2d
Add mox, excoveralls and a test for AutoSyncChannel 2019-09-13 16:03:20 -07:00
Connor Rigby 00003c2a96
Implement dump_info sys_call 2019-09-13 16:03:19 -07:00
Connor Rigby 33c0046fff
Update auto_sync_channel to cast updates to respective workers 2019-09-13 16:03:18 -07:00
Rick Carlino 295cb45d49
Transport => Channel 2019-09-13 16:03:17 -07:00
Rick Carlino 62173829e9
AutoSyncTransport => AutoSyncChannel 2019-09-13 16:03:17 -07:00