Commit Graph

4 Commits

Author SHA1 Message Date
Sunny f5a2940cd7 Update controller e2e tests
Rewrite the controller tests to test the new behavior of the reconciler
and also simplify the tests for scenarios that are now being tests in
internal/source package, especially the git operations related tests.
Some of the old controller tests are still kept to ensure those
functionalities continue to work after the controller rewrite, even if
some of them are redundant. They can be removed in the future for the
tests in the respective subpackages, internal/policy and
internal/source.

New tests that focus the status conditions and notifications have been
added for various possible scenarios.

The test helpers have been modified to simplify their usage and some
have been replaced with their equivalent version from the testutils
package.

Signed-off-by: Sunny <github@darkowlzz.space>
2024-04-18 16:16:09 +05:30
Sunny eabd20bef8 Handle delete before adding finalizer
In Reconcile() method, move the object deletion above add finalizer.
Finalizers can't be set when an object is being deleted.

Introduce a cacheless client in suite_test to use for testing this
change. It ensures that the Reconcile() call always operates on the
latest version of the object which has the deletion timestamp and
existing finalizer.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-07-31 15:32:48 +05:30
Hidde Beydals bfb2a978ad Set controller package name
Set package name in the files under internal/controller to have the
base name of the directory.

This style is recommended by Go, and certain text editors/IDEs get
confused when the names don't match.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-31 13:15:46 +02:00
Hidde Beydals 7cc9c9c5f4 Rename controllers to controller
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-25 10:08:03 +02:00