-
Story
-
Resolution: Done
-
Undefined
-
None
-
None
-
None
-
5
-
False
-
None
-
False
-
+
-
-
-
GITOPS Sprint 229, GITOPS Sprint 230, GITOPS Sprint 231
Background
As part of Epic GITOPS-2470 we need first to identify which tests we have in the operator-e2e repository for gitops-operator, and then apply the corresponding labels according to the part or component that they test:
- argocd
- console
- dex
- kam
- applicationset
...
Approach
We will rename each of the subfolders for the tests, including the component or components that are testing in alphabetical order between underscores, after the first numeric block, and before the test name/description.
Criteria
For labeling, every folder is renamed with three blocks, separated by an underscore "_":
- First block: Compound by two blocks of integers separated by a hyphen:
- Format: X-YYY
- Second block: It has a hyphen-separated ("kebab-case") list of components the test is related to:
- Format: comp1
comp2[...] - It can include component or scope:
- Component:
- argocd
- console
- kam
- dex
- ...
- Scope:
- auth: tests related to RBAC, permissions...
- logging: tests related to logs, notifications, alerts...
- infra: infrastructure validations like networking, cluster nodes, scaling, affinity...
- meta: corresponding checks to metadata, labels, tags, annotations...
- Component:
- Format: comp1
- Third block: It has the name of the test, which is a brief description separated by hyphens :
- Format: test-name-or-description
Examples:
before labeling:
1-008_validate-custom-argocd-namespace
after labeling:
1-008{}argocd{}validate-custom-argocd-namespace
before:
1-078_validate_default_argocd_consoleLink
after:
1-078{}argocd-console{}validate-default-argocd-consoleLink
Convention motivation:
The reasons why this convention has been chosen:
- We don't modify the current naming (except for the "kebab-case" in the third block), instead, we add information in between.
- Keeping the numeric (first) block allow us to have an additional filtering layer (for instance, using odd numbers for sequential tests, and even for parallel ones).
- The selected characters are literal characters in REGEX, avoiding using special characters (., +, {}, {}?, {}^, {}$, {}(), {}[], {}{}, {}|, {}{*}). This has the below benefits:
- You can easily access a "block" by using the underscore "_" as a field separator.
- Is easy to split the second (components) block by using the hyphen "-" as a field separator (the semicolon ";" could be problematic in most Unix-like shells).
- We just use two literal characters ("_" and "-") to split and manipulate all information. Even a simple tool like "cut" can manage this.
- Don't need to escape special characters in almost any language.
Acceptance Criteria
- A new branch in operator-e2e forked from master, where all tests have been labeled (renamed) with their respective parts or components.
- New MR to request validation from the rest of the QE team.