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

Added Unit test case for events sub commands #305

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

codinja1188
Copy link
Contributor

Added Unit test case for events sub commands

@ctreatma ctreatma temporarily deployed to external July 18, 2023 14:40 — with GitHub Actions Inactive
@ctreatma
Copy link
Contributor

Now that the e2e tests have been moved to a separate workflow, the e2e test files should be moved into the test/e2e directory and you can remove the testing.Short() check.

test/e2e/event_test.go Outdated Show resolved Hide resolved
@codinja1188 codinja1188 temporarily deployed to external July 24, 2023 16:37 — with GitHub Actions Inactive
@ctreatma ctreatma temporarily deployed to external July 24, 2023 18:30 — with GitHub Actions Inactive
@codinja1188 codinja1188 temporarily deployed to external July 25, 2023 14:27 — with GitHub Actions Inactive
@ctreatma
Copy link
Contributor

Note that the tests are failing due to what looks like a 10-minute timeout (the timeout is happening in the test code, it's not an API request timeout). https://github.com/equinix/metal-cli/actions/runs/5648492098/job/15300834778

@ctreatma
Copy link
Contributor

I think this is failing because of the sheer number of available events; the paginator is trying to load all of them and there are so many that it's taking too long for the test to pass. For now, lets update the test to do a metal project get, capture the ID of the first project, and then run metal events get -p <first project ID>. We should probably only check that the events command succeeded for now, instead of checking for specific event types in the output; we can come back later and improve on that.

test/e2e/event_test.go Outdated Show resolved Hide resolved
@codinja1188 codinja1188 mentioned this pull request Aug 16, 2023
15 tasks
@codinja1188 codinja1188 temporarily deployed to external August 30, 2023 15:16 — with GitHub Actions Inactive
@codinja1188 codinja1188 temporarily deployed to external August 31, 2023 14:09 — with GitHub Actions Inactive
},
want: &cobra.Command{},
cmdFunc: func(t *testing.T, c *cobra.Command) {
root := c.Root()
Copy link
Contributor

Choose a reason for hiding this comment

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

You even added a device events test! Nice!

@ctreatma ctreatma merged commit c7eed25 into equinix:main Aug 31, 2023
7 checks passed
ocobles pushed a commit that referenced this pull request Nov 10, 2023
Added Unit test case for events sub commands
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.

2 participants