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 myHub Api tests #363

Merged
merged 4 commits into from
Feb 3, 2022
Merged

Added myHub Api tests #363

merged 4 commits into from
Feb 3, 2022

Conversation

Aman-Codes
Copy link
Contributor

@Aman-Codes Aman-Codes commented Jan 31, 2022

Proposed changes

Summarize your changes here to communicate with the reviewers and make sure to put the link of the related issue

How has this been tested:

  • Test environment
    • GKE
    • AWS
    • OpenShift
    • KinD/k3s/k3d cluster
    • Others
  • Tested with production environment ( For ChaosCenter Tests )
  • Have not tested

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • I have added necessary documentation (if appropriate)
  • I have added Screenshots or Terminal snippets in the PR comment to validate the successful execution of changes

Documentation

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • data-cy=* parameters have been added in codebase ( ChaosCenter Tests )
  • data-cy=* parameters need to be added in codebase ( ChaosCenter Tests )
  • No updates required.

Code Review

  • Does the test handle fatal exceptions, ie. uncaught exceptions from 3rd party library (if any)

Special notes for your reviewer:

Out of 23 tests 17 tests passed and 6 tests failed. The six failing tests are:

  1. Fetching the experiment manifest from the hub of a project with no access [ Should not be possible ]
  2. Fetching all the pre-defined workflows of a project with no access [ Should not be possible ]
  3. Fetching the pre-defined experiment manifest from a hub of a project with no access [ Should not be possible ]
  4. Deleting the hub of a project with no access [ Should not be possible ]
  5. Deleting the hub of a project with viewer access [ Should not be possible ]
  6. Syncing the hub of a project with no access [ Should not be possible ]

These tests will pass after the appropriate fix are merged (Tracked on #362)
cc @Jonsy13

image

Signed-off-by: Aman Dwivedi <[email protected]>
@Jonsy13 Jonsy13 requested review from Jonsy13 and amityt February 1, 2022 12:08
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
"project_id": project2Id,
"user_id": user2Id
}
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can logout user2 here also.

Copy link
Collaborator

@Jonsy13 Jonsy13 left a comment

Choose a reason for hiding this comment

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

Looks good!, PTAL on minor comments as discussed.

Signed-off-by: Aman Dwivedi <[email protected]>
@Aman-Codes
Copy link
Contributor Author

@Jonsy13 Changes added in last commit:

  • Logged out the user in securityCheckSetup function and logging in again before test run
  • Moved myhub tests inside Api_Tests folder
  • Integrated ESLint and Prettier
  • Added scripts for linting checks: npm run lint, npm run checkformat, npm run format
  • Fixed the warnings and errors from ESLint and Prettier

Copy link
Collaborator

@Jonsy13 Jonsy13 left a comment

Choose a reason for hiding this comment

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

Thanks!!..LGTM

@Jonsy13 Jonsy13 merged commit 236c22c into litmuschaos:master Feb 3, 2022
@Aman-Codes Aman-Codes deleted the myHubTest branch February 4, 2022 16:04
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