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

Readme for the Testing - detailed instructions for functional testing usage and addition of new tests #983

Merged
merged 26 commits into from
Jun 6, 2024

Conversation

nanda-katikaneni
Copy link
Collaborator

@nanda-katikaneni nanda-katikaneni commented Mar 11, 2024

🗣 Description

Create a high-level Readme for the testing folder with detailed instructions for:

  • Functional Testing - Structure and High Level Details
  • Functional Testing Usage with Examples
  • Functional Testing - Adding New Test Cases with Examples

💭 Motivation and context

closes #735

🧪 Testing

  • Run functional tests for a product using the instructions
  • Add a new test using the instructions

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • PR targets the correct parent branch (e.g., main or release-name) for merge.
  • Changes are limited to a single goal - eschew scope creep!
  • Changes are sized such that they do not touch excessive number of files.
  • All future TODOs are captured in issues, which are referenced in code comments.
  • These code changes follow the ScubaGear content style guide.
  • Related issues these changes resolve are linked preferably via closing keywords.
  • All relevant type-of-change labels added.
  • All relevant project fields are set.
  • All relevant repo and/or project documentation updated to reflect these changes.
  • All automated checks (e.g., linting, static analysis, unit/smoke tests) passed.

✅ Pre-merge checklist

  • PR passed smoke test check.

  • Feature branch has been rebased against changes from parent branch, as needed

    Use Rebase branch button below or use this reference to rebase from the command line.

  • Resolved all merge conflicts on branch

  • Notified merge coordinator that PR is ready for merge via comment mention

✅ Post-merge checklist

  • Feature branch deleted after merge to clean up repository.
  • Verified that all checks pass on parent branch (e.g., main or release-name) after merge.

@nanda-katikaneni nanda-katikaneni added documentation This issue or pull request improves or adds to documentation Testing This issue or task involves testing the automation tool function labels Mar 11, 2024
@nanda-katikaneni nanda-katikaneni added this to the Glacier milestone Mar 11, 2024
@nanda-katikaneni nanda-katikaneni self-assigned this Mar 11, 2024
@nanda-katikaneni nanda-katikaneni force-pushed the 735-FunctionalTests-Documentation branch from a88ad41 to 810dd67 Compare March 11, 2024 16:35
@rgbrow1949 rgbrow1949 self-requested a review March 14, 2024 17:16
@nanda-katikaneni nanda-katikaneni force-pushed the 735-FunctionalTests-Documentation branch from 9bc2d11 to 89490a5 Compare March 21, 2024 16:13
@nanda-katikaneni nanda-katikaneni marked this pull request as ready for review March 21, 2024 16:14
@nanda-katikaneni nanda-katikaneni requested review from tkol2022 and removed request for james-garriss March 21, 2024 16:25
Copy link
Collaborator

@rgbrow1949 rgbrow1949 left a comment

Choose a reason for hiding this comment

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

The instructions look good, but this branch needs a rebase and there are unit tests that are currently failing

@tkol2022 tkol2022 modified the milestones: Glacier, Halibut Mar 27, 2024
@tkol2022
Copy link
Collaborator

Pushed to halibut so that we have more time to make content revisions and complete a review.

@tkol2022
Copy link
Collaborator

In the instructions where Pester is installed and you have prerequisites, you are missing a step to install Selenium. That is before running the Update Selenium script.
Install-Module Selenium

@tkol2022
Copy link
Collaborator

I noticed in the section where we tell the reader to "kill any ChromeDriver.exe processes", I found that those processes are sometimes hidden under the Powershell app and you cannot locate them in the main process list. Although the ChromeDriver.exe is not shown in my screenshot below, that is where I saw an instance of it earlier. Add this information to the instructions.

image

@tkol2022
Copy link
Collaborator

Today when I tried running the functional tests, I was a getting a random error (forgot to take a screenshot) that was unrelated to any of our code. Selenium just wasn't working right for whatever reason and I cannot recall this ever happening before. I updated the ChromeDriver.exe but that didn't fix the problem so I ended up having to do what's below and now I can run the orchestrator again:

uninstall-module Selenium
install-module Selenium
./Testing/Functional/SmokeTest/UpdateSelenium.ps1

@tkol2022
Copy link
Collaborator

The README created for this PR is oriented to users (i.e. developers, testers) that want to execute the test orchestrator. I think you should add a couple of sentences at the top that makes this more obvious and change the title of the document to ScubaGear Functional Testing Automation for Developers and Testers.

On that note, I had developed a couple of ancillary guides for us admins which are related to setting up the infrastructure (service principals, user provisioning, etc.). Can we add a link to those GitHub issues in this document for easy reference?

@tkol2022
Copy link
Collaborator

tkol2022 commented Apr 30, 2024

In your Functional Testing Usage section make it clear that the addition of the Thumbprint field to the -Data parameter is what makes the orchestrator run in service principal mode and that the thumbprint must correspond to the end user's client certificate which should be installed on the machine running the test plans.

See #592 for example.

image

I would just copy the following sections verbatim because they contain a lot of details and some of that stuff is missing from your README.
#592 (comment)
#592 (comment)

@tkol2022
Copy link
Collaborator

Throughout the document I think it would be better to use the voice "you need to do this" instead of the third person "the user should do this". This makes the document easier to follow as a set of instructions directed at the reader.

@tkol2022
Copy link
Collaborator

Add a section with the Powershell code to generate a user client certificate.

$CertName = "ScubaServicePrincipal"
$CertParams = @{
    Subject = $CertName
    KeySpec = "KeyExchange"
    CertStoreLocation = "Cert:\CurrentUser\My"
}

$MyCert = New-SelfSignedCertificate @CertParams
Write-Output $MyCert


########## Exporting the cert public key (this is so you can upload the file to the Azure AD application as a credential)
Export-Certificate -Cert $MyCert -Type CERT -FilePath .\ScubaServicePrincipal.cer

@tkol2022
Copy link
Collaborator

Replace "AAD functional testing in service principal mode by filtering specific test cases" with "When developing or if you are testing pull requests you may need to execute just a single baseline policy in the respective YAML test plan file. To do that you will add Pester filter tags to the PesterConfig parameter. See an example to execute the policy MS.AAD.2.1v1 test cases below."

@tkol2022
Copy link
Collaborator

"Product functional tests are being run for multiple product-tenant combinations. Development team should check the successful completion of these runs for any regressions. "

It is not clear when the development team should check this? Is this more the job of the operations team?

Also, for performing regression tests, one option that a developer can exercise is to run the nightly product functional test via the GitHub actions against their branch although since that runs all of the products and all of the test cases, I think we should determine a more efficient way to do that if we ever want this option.

@tkol2022
Copy link
Collaborator

I don't see a reference to the sample functional test execution script that is reference in this comment. That might make it easier for developers.

#592 (comment)

@nanda-katikaneni nanda-katikaneni force-pushed the 735-FunctionalTests-Documentation branch from 7419206 to e930f6a Compare May 30, 2024 15:43
Copy link
Collaborator

@tkol2022 tkol2022 left a comment

Choose a reason for hiding this comment

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

Nice work. I have previously gone through the documentation and suggested tweaks. The overall team is doing a dry run of this document for release functional testing right now.

Copy link
Collaborator

@james-garriss james-garriss left a comment

Choose a reason for hiding this comment

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

Good work!

Testing/Readme.md Show resolved Hide resolved
Testing/Readme.md Show resolved Hide resolved
Testing/Readme.md Outdated Show resolved Hide resolved
Testing/Readme.md Outdated Show resolved Hide resolved
Testing/Readme.md Outdated Show resolved Hide resolved
Testing/Readme.md Outdated Show resolved Hide resolved
Testing/Readme.md Outdated Show resolved Hide resolved
Testing/Readme.md Outdated Show resolved Hide resolved
@nanda-katikaneni nanda-katikaneni force-pushed the 735-FunctionalTests-Documentation branch from e930f6a to 1e482f9 Compare June 6, 2024 00:34
@nanda-katikaneni nanda-katikaneni merged commit d76d201 into main Jun 6, 2024
14 checks passed
@nanda-katikaneni nanda-katikaneni deleted the 735-FunctionalTests-Documentation branch June 6, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This issue or pull request improves or adds to documentation Testing This issue or task involves testing the automation tool function
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding Functional Auto Test Plan Documentation into Repo ReadMe
5 participants