4241 Commits

Author SHA1 Message Date
ionutboangiu
fabdf9702e fix ExtraFields not being cloned in CallDescriptor.Clone 2026-02-09 11:18:53 +01:00
arberkatellari
7171efa579 Switch from fiorix/go-diameter library to cgrates/go-diameter 2026-01-13 18:52:02 +01:00
ionutboangiu
117fee4e29 Relicense from GPLv3 to AGPLv3 2025-10-29 19:42:24 +01:00
ionutboangiu
547c4940ec skip empty removeIndexKeys to avoid slow ops 2025-09-09 10:07:55 +02:00
armirveliaj
379f467ff7 Add non-indexed variants of indexable filter types 2025-07-10 16:32:51 +02:00
ionutboangiu
9f3ebf80c4 remove redundant dm init in test flush helper 2025-05-27 17:28:40 +02:00
ionutboangiu
0feda9e993 close db connections in test flush helpers
Previously, database connections would stay alive until "go test"
would finish, sometimes leading to max conn errors.
2025-05-27 17:28:40 +02:00
ionutboangiu
ea77f357f2 prevent panic when len(AlteredFields) == 0 2025-04-07 09:05:21 +02:00
ionutboangiu
23a4c98f8f Fix vet warnings following go version update 2025-03-16 16:27:24 +01:00
ionutboangiu
9db1fac75f Fix thresholds unit test by extending snooze 2024-12-10 18:55:04 +01:00
arberkatellari
7add01320e Revise balance blockers 2024-09-09 16:43:27 +02:00
arberkatellari
88ff4d9c4f Add active time checker on DebitConnectionFee 2024-09-09 16:43:27 +02:00
ionutboangiu
df7b65833a remove deprecated math/rand.Seed calls
see https://pkg.go.dev/math/rand#Seed
2024-09-05 20:58:34 +02:00
ionutboangiu
0aa5cf38e8 apply partial debit before stopping due to blocker 2024-09-05 20:57:43 +02:00
ionutboangiu
668f421842 remove unused DryRun field from CallDescriptor
dryRun vars will also not be considered anymore in the balance
blocker condition.
2024-09-05 20:57:43 +02:00
gezimblliku
6c8f53435b fixed go vet warnings 2024-08-16 12:34:25 +02:00
ionutboangiu
d507e29a8f update rpcclient lib (fixes #4413) 2024-08-14 14:05:01 +02:00
ionutboangiu
656911e4aa Exclude expired metrics before retrieval
Remove all StatQueue locking methods (unused).
2024-08-09 09:16:36 +02:00
armirveliaj
7cf8c69bc8 Add new unit tests 2024-08-02 09:36:19 +02:00
armirveliaj
564bb136fe Add new unit tests on engine 2024-07-22 17:34:31 +02:00
armirveliaj
124ac6fbb6 Add new unit tests on engine 2024-07-21 19:05:17 +02:00
armirveliaj
8edc239bd1 Add new unit tests 2024-07-21 19:05:17 +02:00
ionutboangiu
4e6cbe26c5 Ensure refund flag is not ignored when rerate is true
By default setting rerate to true also sets refund to true, but
flags should take precedence over defaults.

If rerate is true and refund is false, remove any previous
CostDetails from event to force rerate.

Centralize the parsing of processing flags.
2024-07-14 13:29:23 +02:00
arberkatellari
8269e0b99c Update rpcclient revising error handling 2024-06-30 17:55:32 +02:00
ionutboangiu
7a7b928aa0 Don't trim single digit values when parsing cron
Fixes an issue where 0 values would become empty inside the cron
expressions.

Added unit tests for the edge cases and grouped them together with
the previous ones under the same table test.
2024-06-30 17:52:29 +02:00
gezimbll
bf700c9d72 remove duplicate map of aliases on getExtraFields() 2024-06-07 17:14:17 +02:00
gezimbll
fccda430c9 added aliases for extra_fields 2024-06-07 17:14:17 +02:00
gezimbll
9dfd36e7f2 updated RemTpData to check args map in switch case 2024-06-07 16:41:29 +02:00
ionutboangiu
c3f47d5119 Optimize removeFilterIndexesForFilter function + tests
Previously made two trips (get and set) for each group of items from
an index key being removed. Now, we fetch indexes once at the beginning
and store the updated indexes once at the end.

Related to #4357
2024-06-06 13:29:10 +02:00
ionutboangiu
4daeb35609 Reduce client connection attempts to test engine status (tests)
200 -> 16

Previously, considering the fibonacci back off strategy, if engine failed to
start it would have tried to attempt connections for 2.862799e+33 years.

Now, the amount of attempts is 16, equivalent to around 2 and a half seconds.
Should be more than enough, considering that usually 6-7 attempts are enough.
2024-06-06 11:13:32 +02:00
ionutboangiu
c0b665a015 Make go vet pass
The rpcclient constructor could not see the centralized
Encoding flag because it didn't have the necessary build
constraints. Added the constraints in lib_test.go files
where it wasn't alone. In all the other cases, it was
moved to the first file where it was needed.

Moved resources cache tests relying on DBType flag value
to a separate integration test file. Before it was getting
skipped for *internal anyway.
2024-06-06 11:13:32 +02:00
ionutboangiu
454c0552f2 Centralize test flags in utils for shared use across tests 2024-06-06 11:13:32 +02:00
gezimbll
27a9179ab8 revise threshold snooze time to update only after sleep interval 2024-05-07 13:39:32 +02:00
ionutboangiu
56f8549ea4 Ensure EC FieldAsInterface method works correctly
- trim fldPath Increments before retrieving the field
- Rating map can be accessed from Accounting
- ExtraCharges can be accessed from Accounting
- RatingUnit fields that did not represent the id of
another EC struct are now retrievable
- add unit tests
2024-04-11 13:23:23 +02:00
ionutboangiu
7eb78cb40e Rename composeURI func to composeMongoURI
To reflect that it's used exclusively for MongoDB (for now at least).

Also added a descriptive comment to the function.
2023-12-07 16:57:43 +01:00
ionutboangiu
f23179899c Revise buildURL function
Renamed to composeURI.

Use simple string concatenation to build URI because there is
no need to keep the Parse call as a validation step. Any issue
would be caught when establishing a connection.
2023-12-07 16:57:43 +01:00
ionutboangiu
4eb2b9d5d4 Replace deprecated Publish method with PublishWithContext 2023-10-27 18:51:42 +02:00
gezimbll
09619a8442 adding tests for internal storage 2023-10-16 18:17:11 +03:00
gezimbll
78ef6209da Adding tests for internal storage 2023-10-16 18:17:11 +03:00
gezimbll
c82596c810 Adding tests for internal storage 2023-10-16 13:34:29 +03:00
ionutboangiu
950c5279a6 Delete gob marshaler test until we find a solution
Marshalling a value using GOBMarshaler seems to yield
inconsistent sets of bytes.
2023-10-16 13:31:14 +03:00
NikolasPetriti
49f0fa439c Add coverage tests for engine 2023-09-15 13:52:49 +02:00
NikolasPetriti
870b6e87ae Add gofmt 2023-09-01 17:28:31 +02:00
NikolasPetriti
fe2f034a7a Add coverage tests for config and engine 2023-09-01 17:28:31 +02:00
NikolasPetriti
7050622bc3 Add coverage tests for utils 2023-08-28 12:18:54 +02:00
NikolasPetriti
f7807d26af Add coverage tests for engine 2023-08-28 12:18:54 +02:00
NikolasPetriti
3e7394de75 Add coverage tests for engine 2023-08-28 12:18:54 +02:00
NikolasPetriti
bcf26daf5a Add coverage tests for engine 2023-08-28 12:18:54 +02:00
NikolasPetriti
b590767fc2 Add coverage tests for engine 2023-08-28 12:18:54 +02:00
NikolasPetriti
97b65f9718 Add coverage tests for engine 2023-08-28 12:18:54 +02:00