jordigilh commented on code in PR #337:
URL:
https://github.com/apache/incubator-kie-kogito-serverless-operator/pull/337#discussion_r1439551251
##########
test/e2e/workflow_test.go:
##########
@@ -253,26 +257,173 @@ var _ = Describe("SonataFlow Operator", Ordered, func() {
}, time.Minute, time.Second).Should(Succeed())
})
})
+
+ const (
+ ephemeral = "ephemeral"
+ postgreSQL = "postgreSQL"
+ dev = "dev"
+ production = "production"
Review Comment:
Let's hypothesize into the different scenarios:
A) Use the `ProfileType` constant in the dev source code for the profile
type to define the name used in the directory to hold the two current
scenarios: `dev` and `production`.
Outcomes of changing the values of these types in the development code when
running the e2e tests without any changes to it will be the following in order
of occurrence:
1. Tests failing because the test code is unable to find the test data.
2. Once resolved, the test will now fail because the expected results don't
match.
B) Define a local variable in the E2E tests to manage the directory names
for any profile defined, that is `dev`, `production` or `undefined`, or any new
profile type defined in the future. Independently from how is structured or
defined in the development source code.
Outcomes of changing the values of these types in the development code when
running the e2e tests without any changes will be the following in order of
occurrence:
1. The test fail because the expected results don't match.
By avoiding reuse of development code in the e2e test code and vice versa we
are free from making changes to both source codes without impacting each other.
Furthermore, e2e tests shall consider the application under test as a black box
which provides an input and output interfaces that are used by the e2e code to
validate its correctness. If we reuse the development code in the e2e test, we
are breaking this barrier that will lead to the problem I described earlier.
Note that this rule is not the case for unit and integration tests since the
scope of the test requires reuse of the development code to mock or validate
API interfaces or structures that are internal to the application and not
exposed externally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]