- added hook support (executed after parsing config but before starting
engine)
- made db resets configurable
- merged config parsing helper with the main Setup function
- renamed TestEnvironment.Setup -> TestEngine.Run as it represents the
setup for a single cgr-engine instance
- removed engineDelay parameter. Added helper to wait up to 200ms for
the APIerSv1 service to be up and running to prevent 'can't find
service' errors.
- replaced t.Log with t.Error for engine process kill error
- improved option comments
- shortened the failed post cache ttl to 1ms to simulate with more
than one events file
- use the default FailedPath (which is the same as SourcePath) to check
whether writing events that failed to be replayed to the same path
would cause an infinite loop.
- renamed parameter type: ArgsReplyFailedPosts -> ReplayFailedPostsParams
- renamed param fields:
- FailedRequestsInDir -> SourcePath
- FailedRequestsOutDir -> FailedPath
- changed param fields types from *string to string
- used the SourcePath and FailedPath params directly instead of creating separate variables
- used filepath.WalkDir instead of reading the directory and looping over the entries
- used slices.ContainsFunc to check if the file belongs to any module (if 1+ is specified)
- used filepath.Join instead of path.Join
- used the path provided by WalkFunc instead of building the file paths ourselves
- made error returns more descriptive
- added logs for directories/files that are skipped
- paths that cannot be accessed are skipped after logging the error
- Pass the testing.T variable to all the helpers.
- Fail directly using t.Fatal instead of returning errors and
checking them in the parent function.
- Use t.Cleanup to ensure engine is closed after the test instead
of returning a shutdown function and using it with defer.
- Use t.TempDir to create temporary directories for configuration
and tariffplans
- Add t.Helper() method call to all helper functions.
CGREventWithEeIDs has also been optimized and properly tested. Comments
have been added explaining the process.
When sending a request to AttributeS from EEs, CostDetails from the reply
will now be overwritten by the original CostDetails to preserve its type.
The downside is that we are assuming that CostDetails was not altered by
AttributeS. We might consider adding a type check against *engine.EventCost
to at least stay backwards compatible with *gob and *internal connections.
general_tests/ees_it_test.go has been updated to ensure changes are working
properly.