Skip to content

Commit d83bd92

Browse files
committed
chore: forward-port release-1.3
Signed-off-by: Francesco Noacco <francesco.noacco@secomind.com>
2 parents 47e5bd1 + 3497cb0 commit d83bd92

File tree

40 files changed

+546
-449
lines changed

40 files changed

+546
-449
lines changed

.github/workflows/publish-release-to-dockerhub-workflow.yaml

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,6 @@ on:
1111
type: string
1212

1313
jobs:
14-
astarte_appengine_api:
15-
uses: ./.github/workflows/astarte-apps-build-workflow.yaml
16-
with:
17-
app: "astarte_appengine_api"
18-
secrets: inherit
19-
20-
astarte_data_updater_plant:
21-
uses: ./.github/workflows/astarte-apps-build-workflow.yaml
22-
with:
23-
app: "astarte_data_updater_plant"
24-
secrets: inherit
25-
26-
astarte_housekeeping:
27-
uses: ./.github/workflows/astarte-apps-build-workflow.yaml
28-
with:
29-
app: "astarte_housekeeping"
30-
secrets: inherit
31-
32-
astarte_pairing:
33-
uses: ./.github/workflows/astarte-apps-build-workflow.yaml
34-
with:
35-
app: "astarte_pairing"
36-
secrets: inherit
37-
38-
astarte_realm_management:
39-
uses: ./.github/workflows/astarte-apps-build-workflow.yaml
40-
with:
41-
app: "astarte_realm_management"
42-
secrets: inherit
43-
44-
astarte_trigger_engine:
45-
uses: ./.github/workflows/astarte-apps-build-workflow.yaml
46-
with:
47-
app: "astarte_trigger_engine"
48-
secrets: inherit
49-
50-
e2e_tests:
51-
uses: ./.github/workflows/astarte-end-to-end-test-workflow.yaml
52-
5314
build_release:
5415
name: Push Docker images to Docker Hub
5516
runs-on: ${{ matrix.platform.os }}
@@ -75,14 +36,6 @@ jobs:
7536
- astarte_pairing
7637
- astarte_realm_management
7738
- astarte_trigger_engine
78-
needs:
79-
- astarte_appengine_api
80-
- astarte_data_updater_plant
81-
- astarte_housekeeping
82-
- astarte_pairing
83-
- astarte_realm_management
84-
- astarte_trigger_engine
85-
- e2e_tests
8639
steps:
8740
- name: Check out the repo
8841
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2323
- `ASTARTE_BASE_URL_DOMAIN` - domain part of the base URL of astarte, used by devices to connect in TO2 phase (required if FDO enabled)
2424
- `ASTARTE_BASE_URL_PORT` - port of the base URL of astarte (required if FDO enabled)
2525
- `ASTARTE_BASE_URL_PROTOCOL` - protocol of the base URL of astarte (required if FDO enabled)
26+
- `PAIRING_FDO_RENDEZVOUS_SSL_ENABLED` - whether SSL is enabled for the connection to the rendezvous server (default: false)
27+
- `PAIRING_FDO_RENDEZVOUS_SSL_CA_FILE` - path to the CA certificate file for the rendezvous server TLS connection; when not specified, the bundled cURL certificate bundle will be used
28+
- `PAIRING_FDO_RENDEZVOUS_SSL_DISABLE_SNI` - disable Server Name Indication for the rendezvous server TLS connection (default: false)
29+
- `PAIRING_FDO_RENDEZVOUS_SSL_CUSTOM_SNI` - custom SNI hostname for the rendezvous server TLS connection; when not specified, the Rendezvous hostname will be used
2630

2731
- [astarte_housekeeping] AMQP management configuration moved to `astarte_events` library. Environment variables changed:
2832
- `HOUSEKEEPING_AMQP_SSL_ENABLED` is now `ASTARTE_EVENTS_AMQP_MANAGEMENT_SSL_ENABLED`
@@ -108,15 +112,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
108112
- [astarte_data_updater_plant] Correctly encode values when sending properties to device on connection
109113
- [astarte_realm_management] Allow to delete long-disconnected devices. For this to work, Realm Management needs `CLUSTERING_STRATEGY`, `CLUSTERING_KUBERNETES_NAMESPACE` and `DATA_UPDATER_PLANT_CLUSTERING_KUBERNETES_SELECTOR` to be set, just like AppEngine and DUP. Refer to 1.2.1-rc.0 for additional information on the variables.
110114

111-
## [1.2.1] - Unreleased
115+
## [1.2.1] - 2026-03-12
112116

113117
### Fixed
114118

115119
- [astarte_realm_management] Insufficient validation for conflicting options in interface aggregate mappings
116120
[#1072](https://github.com/astarte-platform/astarte/issues/1072)
121+
- [astarte_data_updater_plant] Ensure device deletion rpc always checks updated status
117122

118123
## [1.2.1-rc.1] - 2026-02-13
119124

125+
### Fixed
126+
120127
- [astarte_realm_management] Bug where devices got stuck in the "in deletion" status: [#1493](https://github.com/astarte-platform/astarte/issues/1493).
121128
- [astarte_data_updater_plant] Correctly reconnect to AMQP after a connection loss
122129
- [astarte_data_updater_plant] Fix possible crash when sending data on interface-specific volatile triggers

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Astarte
22

3-
![](https://github.com/astarte-platform/astarte/workflows/Build%20and%20Test%20Astarte%20Apps/badge.svg?branch=v1.2.0)
4-
[![codecov](https://codecov.io/gh/astarte-platform/astarte/tag/v1.2.0/graph/badge.svg)](https://codecov.io/gh/astarte-platform/astarte)
3+
![](https://github.com/astarte-platform/astarte/workflows/Build%20and%20Test%20Astarte%20Apps/badge.svg?branch=v1.2.1)
4+
[![codecov](https://codecov.io/gh/astarte-platform/astarte/tag/v1.2.1/graph/badge.svg)](https://codecov.io/gh/astarte-platform/astarte)
55

66
<img src="doc/images/mascotte.svg" align="left" width="160px" />Astarte is an Open Source IoT
77
platform focused on Data management and processing written in [Elixir](https://github.com/elixir-lang/elixir).
@@ -34,7 +34,7 @@ Can't be easier. Pick your favorite machine with at least 4GB of free RAM, make
3434
[Docker](https://www.docker.com/), and simply:
3535

3636
```sh
37-
$ git clone https://github.com/astarte-platform/astarte.git -b v1.2.0 && cd astarte
37+
$ git clone https://github.com/astarte-platform/astarte.git -b v1.2.1 && cd astarte
3838
$ docker run -v $(pwd)/compose:/compose astarte/docker-compose-initializer:1.1
3939
$ docker compose pull
4040
$ docker compose up -d

apps/astarte_appengine_api/mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# This file is part of Astarte.
33
#
4-
# Copyright 2017-2025 SECO Mind Srl
4+
# Copyright 2017 - 2026 SECO Mind Srl
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -60,7 +60,6 @@ defmodule Astarte.AppEngine.API.Mixfile do
6060
defp astarte_required_modules(_) do
6161
[
6262
{:astarte_core, github: "astarte-platform/astarte_core", override: true},
63-
{:astarte_generators, github: "astarte-platform/astarte_generators", only: [:dev, :test]},
6463
{:astarte_realm_management,
6564
path: "../astarte_realm_management", only: :test, runtime: false}
6665
]
@@ -103,6 +102,7 @@ defmodule Astarte.AppEngine.API.Mixfile do
103102
{:libcluster, "~> 3.3"},
104103
{:astarte_data_access, path: astarte_lib("astarte_data_access")},
105104
{:astarte_rpc, path: astarte_lib("astarte_rpc")},
105+
{:astarte_generators, path: astarte_lib("astarte_generators"), only: [:dev, :test]},
106106
{:horde, "~> 0.9"},
107107
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
108108
# Test section

apps/astarte_appengine_api/mix.lock

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"amqp": {:hex, :amqp, "3.3.2", "6cad7469957b29c517a26a27474828f1db28278a13bcc2e7970db9854a3d3080", [:mix], [{:amqp_client, "~> 3.9", [hex: :amqp_client, repo: "hexpm", optional: false]}], "hexpm", "f977c41d81b65a21234a9158e6491b2296f8bd5bda48d5b611a64b6e0d2c3f31"},
33
"amqp_client": {:hex, :amqp_client, "3.12.14", "2b677bc3f2e2234ba7517042b25d72071a79735042e91f9116bd3c176854b622", [:make, :rebar3], [{:credentials_obfuscation, "3.4.0", [hex: :credentials_obfuscation, repo: "hexpm", optional: false]}, {:rabbit_common, "3.12.14", [hex: :rabbit_common, repo: "hexpm", optional: false]}], "hexpm", "5f70b6c3b1a739790080da4fddc94a867e99f033c4b1edc20d6ff8b8fb4bd160"},
44
"astarte_core": {:git, "https://github.com/astarte-platform/astarte_core.git", "a6efa2e87b7f121cc7656640cdff88c408e180f5", []},
5-
"astarte_generators": {:git, "https://github.com/astarte-platform/astarte_generators.git", "673834e5a90c753c3cc22ad53be20b705c827d4a", []},
65
"astarte_rpc": {:hex, :astarte_rpc, "1.2.0", "dcef7434bf3f19ff30ff0bc245ef2d3b0f9abeb369405713cfd28916a5635926", [:mix], [{:amqp, "~> 3.3", [hex: :amqp, repo: "hexpm", optional: false]}, {:castore, "~> 1.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.12", [hex: :protobuf, repo: "hexpm", optional: false]}, {:skogsra, "~> 2.2", [hex: :skogsra, repo: "hexpm", optional: false]}], "hexpm", "8470ed2f116fa8c9d70845f295f3738529aff123d9d3f98cbfa37107314763cb"},
76
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
87
"castore": {:hex, :castore, "1.0.17", "4f9770d2d45fbd91dcf6bd404cf64e7e58fed04fadda0923dc32acca0badffa2", [:mix], [], "hexpm", "12d24b9d80b910dd3953e165636d68f147a31db945d2dcb9365e441f8b5351e5"},
@@ -13,7 +12,7 @@
1312
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
1413
"cowlib": {:hex, :cowlib, "2.16.0", "54592074ebbbb92ee4746c8a8846e5605052f29309d3a873468d76cdf932076f", [:make, :rebar3], [], "hexpm", "7f478d80d66b747344f0ea7708c187645cfcc08b11aa424632f78e25bf05db51"},
1514
"credentials_obfuscation": {:hex, :credentials_obfuscation, "3.4.0", "34e18b126b3aefd6e8143776fbe1ceceea6792307c99ac5ee8687911f048cfd7", [:rebar3], [], "hexpm", "738ace0ed5545d2710d3f7383906fc6f6b582d019036e5269c4dbd85dbced566"},
16-
"credo": {:hex, :credo, "1.7.16", "a9f1389d13d19c631cb123c77a813dbf16449a2aebf602f590defa08953309d4", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "d0562af33756b21f248f066a9119e3890722031b6d199f22e3cf95550e4f1579"},
15+
"credo": {:hex, :credo, "1.7.17", "f92b6aa5b26301eaa5a35e4d48ebf5aa1e7094ac00ae38f87086c562caf8a22f", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1eb5645c835f0b6c9b5410f94b5a185057bcf6d62a9c2b476da971cde8749645"},
1716
"current_rabbit_pool": {:hex, :current_rabbit_pool, "1.1.1", "3a9594f62fdeef845ebd75833659dd821174b51bd013a53c269bf43e67ba8df6", [:mix], [{:amqp, "~> 3.1", [hex: :amqp, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}], "hexpm", "69791022a2e818e55a6535ddea623b1240d44c9640ac5ddc99e07262ee711b2b"},
1817
"cyanide": {:hex, :cyanide, "2.0.0", "f97b700b87f9b0679ae812f0c4b7fe35ea6541a4121a096cf10287941b7a6d55", [:mix], [], "hexpm", "7f9748251804c2a2115b539202568e1117ab2f0ae09875853fb89cc94ae19dd1"},
1918
"db_connection": {:hex, :db_connection, "2.9.0", "a6a97c5c958a2d7091a58a9be40caf41ab496b0701d21e1d1abff3fa27a7f371", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "17d502eacaf61829db98facf6f20808ed33da6ccf495354a41e64fe42f9c509c"},

apps/astarte_appengine_api/test/astarte_appengine_api/device/device_reading_v2_test.exs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# This file is part of Astarte.
33
#
4-
# Copyright 2025 SECO Mind Srl
4+
# Copyright 2025 - 2026 SECO Mind Srl
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -16,18 +16,18 @@
1616
# limitations under the License.
1717

1818
defmodule Astarte.AppEngine.API.Device.DeviceReadingV2Test do
19+
use ExUnitProperties
1920
use Astarte.Cases.Data, async: true
20-
2121
use Astarte.Cases.Device
22-
use ExUnitProperties
2322

24-
alias Astarte.AppEngine.API.Device
25-
alias Astarte.AppEngine.API.Device.InterfaceValues
23+
import Astarte.Helpers.Device
24+
2625
alias Astarte.DataAccess.Realms.Realm
2726
alias Astarte.DataAccess.Repo
2827

29-
import Astarte.Helpers.Device
30-
import Astarte.InterfaceUpdateGenerators
28+
alias Astarte.AppEngine.API.Device
29+
alias Astarte.AppEngine.API.Device.InterfaceValues
30+
alias Astarte.Generators.InterfaceUpdate, as: InterfaceUpdateGenerator
3131

3232
describe "get_interface_value" do
3333
setup context do
@@ -48,10 +48,9 @@ defmodule Astarte.AppEngine.API.Device.DeviceReadingV2Test do
4848

4949
valid_interfaces_for_update = interfaces |> Enum.filter(&(&1.ownership == :server))
5050

51-
check all(
52-
interface_to_update <- member_of(valid_interfaces_for_update),
53-
mapping_update <- valid_mapping_update_for(interface_to_update)
54-
) do
51+
check all interface_to_update <- member_of(valid_interfaces_for_update),
52+
mapping_update <-
53+
InterfaceUpdateGenerator.valid_mapping_update_for(interface_to_update) do
5554
%{
5655
interface_to_update: interface_to_update,
5756
read_path: read_path,
@@ -81,7 +80,8 @@ defmodule Astarte.AppEngine.API.Device.DeviceReadingV2Test do
8180
valid_interfaces_for_update = interfaces |> Enum.filter(&(&1.ownership == :server))
8281

8382
check all interface_to_update <- member_of(valid_interfaces_for_update),
84-
mapping_update <- valid_mapping_update_for(interface_to_update) do
83+
mapping_update <-
84+
InterfaceUpdateGenerator.valid_mapping_update_for(interface_to_update) do
8585
%{
8686
interface_to_update: interface_to_update,
8787
expected_read_value: expected_read_value,
@@ -143,11 +143,10 @@ defmodule Astarte.AppEngine.API.Device.DeviceReadingV2Test do
143143

144144
valid_interfaces_for_update = interfaces |> Enum.filter(&(&1.ownership == :server))
145145

146-
check all(
147-
interface_to_update <- member_of(valid_interfaces_for_update),
148-
mapping_update <- valid_mapping_update_for(interface_to_update),
149-
limit_n <- integer(1..400)
150-
) do
146+
check all interface_to_update <- member_of(valid_interfaces_for_update),
147+
mapping_update <-
148+
InterfaceUpdateGenerator.valid_mapping_update_for(interface_to_update),
149+
limit_n <- integer(1..400) do
151150
%{
152151
interface_to_update: interface_to_update,
153152
expected_read_value: expected_read_value,

apps/astarte_appengine_api/test/astarte_appengine_api/device/device_v2_reading_test.exs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# This file is part of Astarte.
33
#
4-
# Copyright 2025 SECO Mind Srl
4+
# Copyright 2025 - 2026 SECO Mind Srl
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -16,15 +16,16 @@
1616
# limitations under the License.
1717

1818
defmodule Astarte.AppEngine.API.Device.DeviceV2ReadingTest do
19+
use ExUnitProperties
20+
1921
use Astarte.Cases.Data, async: true
2022
use Astarte.Cases.Device
21-
use ExUnitProperties
23+
24+
import Astarte.Helpers.Device
2225

2326
alias Astarte.AppEngine.API.Device
2427
alias Astarte.AppEngine.API.Device.InterfaceValues
25-
26-
import Astarte.Helpers.Device
27-
import Astarte.InterfaceValuesRetrievealGenerators
28+
alias Astarte.Generators.InterfaceValuesRetrieveal, as: InterfaceValuesRetrievealGenerator
2829

2930
setup_all :populate_interfaces
3031

@@ -55,7 +56,10 @@ defmodule Astarte.AppEngine.API.Device.DeviceV2ReadingTest do
5556
check all interface <- member_of(downsampable_interfaces),
5657
"/" <> path <- member_of(downsampable_paths[interface]),
5758
downsample_to <- integer(3..100),
58-
opts <- interface_values_options(downsample_to: downsample_to) do
59+
opts <-
60+
InterfaceValuesRetrievealGenerator.interface_values_options(
61+
downsample_to: downsample_to
62+
) do
5963
{:ok, %InterfaceValues{data: result}} =
6064
Device.get_interface_values!(
6165
realm_name,
@@ -88,7 +92,7 @@ defmodule Astarte.AppEngine.API.Device.DeviceV2ReadingTest do
8892
downsample_key <- member_of(object_keys),
8993
downsample_to <- integer(3..100),
9094
opts <-
91-
interface_values_options(
95+
InterfaceValuesRetrievealGenerator.interface_values_options(
9296
downsample_to: downsample_to,
9397
downsample_key: downsample_key
9498
) do
@@ -125,7 +129,8 @@ defmodule Astarte.AppEngine.API.Device.DeviceV2ReadingTest do
125129
lower_limit <- optional(timestamp_at_least(timings.initial_time)),
126130
to <- optional(timestamp_at_most(timings.last_time)),
127131
params = [{since_or_after, lower_limit}, to: to],
128-
opts <- interface_values_options(params, interface) do
132+
opts <-
133+
InterfaceValuesRetrievealGenerator.interface_values_options(params, interface) do
129134
result =
130135
Device.get_interface_values!(
131136
realm_name,

apps/astarte_appengine_api/test/astarte_appengine_api/device/device_v2_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# This file is part of Astarte.
33
#
4-
# Copyright 2025 SECO Mind Srl
4+
# Copyright 2025 - 2026 SECO Mind Srl
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -20,12 +20,12 @@ defmodule Astarte.AppEngine.API.Device.DeviceV2Test do
2020
use Astarte.Cases.Device
2121
use ExUnitProperties
2222

23+
import Astarte.Generators.InterfaceUpdate
24+
import Astarte.Helpers.Device
25+
2326
alias Astarte.AppEngine.API.Device
2427
alias Astarte.AppEngine.API.Device.InterfaceValues
2528

26-
import Astarte.Helpers.Device
27-
import Astarte.InterfaceUpdateGenerators
28-
2929
describe "update_interface_value" do
3030
property "returns the given value for valid parameters", context do
3131
%{realm_name: realm_name, interfaces: interfaces, device: device} = context

apps/astarte_appengine_api/test/astarte_appengine_api_web/controllers/groups_controller_test.exs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# This file is part of Astarte.
33
#
4-
# Copyright 2019 Ispirata Srl
4+
# Copyright 2019 - 2026 SECO Mind Srl
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -20,11 +20,13 @@ defmodule Astarte.AppEngine.APIWeb.GroupsControllerTest do
2020
use ExUnitProperties
2121
use Astarte.Cases.Conn
2222

23+
alias Astarte.Core.Generators.Device, as: DeviceGenerator
24+
alias Astarte.Core.Generators.Group, as: GroupGenerator
25+
2326
alias Astarte.AppEngine.API.Device
2427
alias Astarte.AppEngine.API.Device.DevicesList
2528
alias Astarte.AppEngine.API.Device.DeviceStatus
2629
alias Astarte.AppEngine.API.Groups
27-
alias Astarte.AppEngine.API.GroupTestGenerator
2830
alias Astarte.Helpers.Database, as: DatabaseTestHelper
2931
alias Astarte.Helpers.JWT, as: JWTTestHelper
3032

@@ -175,7 +177,7 @@ defmodule Astarte.AppEngine.APIWeb.GroupsControllerTest do
175177

176178
@tag issue: 904
177179
property "creates the group with / in group name", %{conn: conn} do
178-
check all group_name <- GroupTestGenerator.group_name() do
180+
check all group_name <- GroupGenerator.name() do
179181
params = %{
180182
"group_name" => group_name,
181183
"devices" => @group_devices
@@ -205,24 +207,22 @@ defmodule Astarte.AppEngine.APIWeb.GroupsControllerTest do
205207
describe "add device" do
206208
setup [:create_group]
207209

208-
test "returns 404 for non-existing group", %{conn: conn} do
209-
params = %{
210-
"device_id" => "aWag-VlVKC--1S-vfzZ9uQ"
211-
}
212-
213-
conn = post(conn, groups_path(conn, :add_device, @realm, "nonexisting"), data: params)
210+
property "returns 404 for non-existing group", %{conn: conn} do
211+
check all device_id <- DeviceGenerator.encoded_id(), max_runs: 10 do
212+
params = %{"device_id" => device_id}
213+
conn = post(conn, groups_path(conn, :add_device, @realm, "nonexisting"), data: params)
214214

215-
assert json_response(conn, 404)["errors"]["detail"] == "Group not found"
215+
assert json_response(conn, 404)["errors"]["detail"] == "Group not found"
216+
end
216217
end
217218

218-
test "fails with non-existing device", %{conn: conn} do
219-
params = %{
220-
"device_id" => "X-Qv0zPMRfiWEXUMHZFNVw"
221-
}
222-
223-
conn = post(conn, groups_path(conn, :add_device, @realm, @group_name), data: params)
219+
property "fails with non-existing device", %{conn: conn} do
220+
check all device_id <- DeviceGenerator.encoded_id(), max_runs: 10 do
221+
params = %{"device_id" => device_id}
222+
conn = post(conn, groups_path(conn, :add_device, @realm, @group_name), data: params)
224223

225-
assert json_response(conn, 422)["errors"]["device_id"] != nil
224+
assert json_response(conn, 422)["errors"]["device_id"] != nil
225+
end
226226
end
227227

228228
test "returns 409 for duplicate device", %{conn: conn} do

0 commit comments

Comments
 (0)