Commit Graph

1193 Commits

Author SHA1 Message Date
ionutboangiu
0bc94857ca Update empty xml_root_path sanity check case.
Also added tests for it.

Added comment to the *HierarchyPath.AsString() function,
addressing the issue of not being able to retrieve the
element when the root path is equal to the path that
is being processed.
2023-10-16 13:31:14 +03:00
ionutboangiu
87044d7c9d Add comments for XmlProvider and xml_root_path opt 2023-10-16 13:31:14 +03:00
ionutboangiu
425c2f2e9b Remove config default value for xml_root_path
The field will remain commented in config_defaults for reference.
2023-10-16 13:31:14 +03:00
ionutboangiu
dd82bb3c4b Add sanity check to prevent xml reader panic
HierarchyPath parser now returns nil when
the path is empty (instead of a string slice with one
EmptyString element).

If the prefix is set to true, when calling the AsString
method on a nil HierarchyPath, only the separator will
be returned. This avoids a nil expr error coming from
the xmlquery library.

Use the Query and QueryAll functions from the xmlquery
package to be able to handle the errors ourselves and
avoid panics.

Added an integration tes for the special case where the
xml_root_path field is left empty. Before the change it
used to trim the root element from the path slice when
attempting to retrieve a the relative path slice.
2023-10-16 13:31:14 +03:00
NikolasPetriti
7f9139a544 Add coverage tests for utils and config 2023-09-06 19:12:15 +03:00
NikolasPetriti
23494cd156 Add coverage tests for config 2023-09-05 18:25:22 +03:00
NikolasPetriti
fe2f034a7a Add coverage tests for config and engine 2023-09-01 17:28:31 +02:00
NikolasPetriti
4d246d7697 Add coverage tests for config 2023-08-31 18:25:15 +02:00
NikolasPetriti
85dce9123d Add gofmt to last commit 2023-08-31 18:25:15 +02:00
NikolasPetriti
d613ab926f Add coverage tests for config 2023-08-31 18:25:15 +02:00
NikolasPetriti
239aaa0a7f Add coverage tests for config 2023-08-29 17:09:48 +02:00
NikolasPetriti
8399e5c5c9 Add coverage tests for config 2023-08-28 12:18:54 +02:00
ionutboangiu
2e9653b551 Apply gofmt 2023-07-18 16:37:06 +02:00
NikolasPetriti
94abb7d7d0 Add coverage tests for utils 2023-07-10 17:12:31 +02:00
NikolasPetriti
b5358d1cea Add coverage tests for config 2023-07-10 14:00:20 +02:00
NikolasPetriti
af290778ad Add coverage tests for config 2023-07-06 17:40:13 +02:00
NikolasPetriti
19666594c8 Add coverage tests for apiercfg.go, smconfig.go, statscfg.go, stordbcfg.gp and supplierscfg.go 2023-07-04 13:20:06 +02:00
NikolasPetriti
0a7ab55836 Add coverage tests for suretaxcfg.go, thresholdscfg.go and xmldp.go 2023-07-04 13:20:06 +02:00
NikolasPetriti
c6de766d18 Add coverage tests for erscfg.go and loaderscfg.go 2023-06-29 20:48:01 +02:00
NikolasPetriti
7042048771 Add coverage tests for fctemplate.go 2023-06-28 10:34:28 +02:00
NikolasPetriti
023cf8f5f2 Added coverage tests for cachecfg.go, datadbcfg.go, erscfg.go, fctemplate.go and rsrparser.go 2023-06-27 11:05:06 +02:00
NikolasPetriti
4c2e81c3a6 Added tests for orderednavigablemap.go, pathitemlist.go and rsrfield.go 2023-06-27 11:05:06 +02:00
NikolasPetriti
65cf7299c8 Added coverage tests for fwvdp.go, objdp.go and removed error variables from source code 2023-06-23 11:55:46 +02:00
NikolasPetriti
86a1fbd531 Coverage tests for fwvdp.go and slicedp.go 2023-06-22 10:39:12 +02:00
ionutboangiu
b7d172f78a Fix misspellings 2023-06-21 11:02:39 +02:00
ionutboangiu
3935a72605 Remove executable bit from .go files 2023-06-16 10:24:13 +02:00
ionutboangiu
8f4a3e8d13 Revise config integration test 2023-06-13 20:14:58 +02:00
ionutboangiu
62619ba3a5 Replace interface{} with any 2023-06-05 10:55:32 +02:00
ionutboangiu
e06fc9eb8d Check if RoundingDecimals is nil before loading
This prevents the nil pointer dereference panic occuring when not set it is not set.
2023-05-22 09:38:57 +02:00
ionutboangiu
a3a8c5a4a4 Make the FCTmpl.RoundingDecimals field a pointer
The purpose of this is to check whether RoundingDecimals was set from the fields configuration.
If it wasn't, we are going to be using the RoundingDecimals dictated by the general subsection.
2023-05-22 07:53:47 +02:00
ionutboangiu
6a6fefd0cd Improve cost formatting and parsing for CDRs
The FormatCost function in cdr.go now accepts an additional parameter of type *config.RSRParser. This is
then used to extract the value from its path as opposed to always using the value of the Cost field directly.

Improved the unit test for the FormatCost function. Now it has become a table-driven test and it handles
cases when the cost is retrieved from different fields other than  from the CDR.
2023-05-22 07:53:47 +02:00
ionutboangiu
cb7ea790de Update rpcclient library to latest version
Replace all instances of rpcclient.ClientConnector with birpc.ClientConnector.

Pass context, maxReconnectInterval, delayFunc and birpcClient to rpcclient
constructors.

Remove redundant time.Duration conversions (e.g. time.Duration(1*time.Second)
now becomes time.Second.

Add context where needed (context.Background() for tests, context.TODO()
for places where it should be passed from somewhere else).

Implement that functionality of the SessionSv1.Sleep call, in sessions/sessions
instead of apier/v1.

Make changes in utils/server.go (replacing the old rpc2 library with github.com/cgrates/birpc).

Change the way we register birpc methods for sessions in services, using a helper function
defined in engine/libengine.go.
2023-05-03 10:02:15 +02:00
gezimbll
7dcbd09a1f replacing non-meta constants for storage types 2023-03-08 19:14:24 +01:00
adi
aeb1cf349a Reverse filter indexes updates + tests 2022-12-06 11:40:38 +02:00
adi
c9a9857152 Added relevant paratheses 2022-12-02 18:39:29 +02:00
ionutboangiu
1436bac61c Remove unnecessary paranthesis 2022-12-02 14:24:18 +02:00
ionutboangiu
a748ab629e Apply gofmt simplify code 2022-12-02 14:24:18 +02:00
ionutboangiu
82468c580d Replace deprecated ioutil library, remove redundant statements + small optimizations 2022-12-02 14:24:18 +02:00
ionutboangiu
758a94280a Apply project wide fmt 2022-11-16 10:13:44 +01:00
adi
a6445f641e Displays messages for agents when connect + fixes on call tests 2022-11-11 17:04:59 +01:00
andronache
428cd37b8e Replaced header in multiple places 2021-11-01 13:50:23 +02:00
Trial97
db3bf9f40d Updated build tags 2021-08-30 17:55:51 +03:00
andronache
07111d1e4d Replacing replicate in datamanager 2021-07-13 19:14:30 +02:00
ionutboangiu
2a00b1cd5e Fix typo (parralel->parallel) v0.10 2021-06-30 20:26:02 +02:00
nickolasdaniel
55d46cfa8a Removed caches_conns from RalsCfg 2021-06-17 15:43:22 +02:00
Trial97
07ef7f2609 Replaced max_call_duration config with default_usage for each ToR 2021-02-19 14:22:48 +01:00
Trial97
102bdeb94a SupplierS Require connections to RALs for calculating the cost 2020-10-20 19:54:47 +02:00
Trial97
e1086b099a Added runtime.Gosched for context switching 2020-09-29 15:47:21 +02:00
TeoV
b91f6d02f8 Append to RALs BalanceRatingSubject instead of overwrite 2020-07-21 14:59:14 +02:00
Trial97
9cc3fb8f6b Updated config integration tests 2020-07-20 16:49:49 +02:00