Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(api): refactor e2e label and annotation test case #515

Open
wants to merge 2 commits into
base: test/api/resource-deletion-step-in-e2e-tests
Choose a base branch
from

Conversation

hardcoretime
Copy link
Contributor

@hardcoretime hardcoretime commented Nov 11, 2024

Description

Why do we need it, and what problem does it solve?

It adapts Label and Annotation test case to updated Virtualization API.

What is the expected result?

Label and Annotation test case will be added to E2E tests workflow.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

@diafour
Copy link
Member

diafour commented Nov 15, 2024

Label and Annotation test case will be added to E2E tests workflow.

Is it "Label and Annotation test case is now a part of E2E tests workflow again."?

And, shouldn't we unlock this test for task run also?

resources:
- ns.yaml
- vi
- overlays/vm-labal-annotation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the directory name: vm-label-annotation

kubectl.Delete(kc.DeleteOptions{
Filename: []string{vmManifest},
FilenameOption: kc.Filename,
Context("When resources are applied:", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

":" is not necessary in context description

Comment on lines +224 to +225
Describe("Annotating", func() {
Context(fmt.Sprintf("When virtual machines in %s phase:", PhaseRunning), func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is only one Context in this Describe. It seems more convenient to merge them into single Context:

Context(fmt.Sprintf("Annotate VirtualMachines in %s phase", PhaseRunning), func() ...

Comment on lines +300 to +301
Context("When test is complited:", func() {
It("tries to delete used resources", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Context("When test is complited:", func() {
It("tries to delete used resources", func() {
Context("When test is completed", func() {
It("should delete all created resources", func() {

Comment on lines +300 to +301
Context("When test is complited:", func() {
It("tries to delete used resources", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, cleanup operation seems strange to be a part of the test suite. Shouldn't it belongs to the test setup actions, something like AfterAll?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants