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

Doc Automation: Command Reference: odo init #6442

Merged

Conversation

valaparthvi
Copy link
Contributor

@valaparthvi valaparthvi commented Dec 27, 2022

What type of PR is this:
/kind tests
/area documentation

What does this PR do / why we need it:

Which issue(s) this PR fixes:

Fixes #6465
Fixes #6468

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

How to test changes / Special notes to the reviewer:

  1. All MDX files should go inside "docs/website/docs//docs-mdx" directory.
  2. All automation related tests should go inside "tests/documentation//"
  3. Every integration test should be specific to it's corresponding MDX file. It's okay to modify the command run output to satisfy the MDX content, for e.g. changing the time taken to download a Devfile/Starter project to the value present in MDX content.
  4. Helper function should not be modified to satisfy the needs for a particular test, specifics should be put inside the tests; for e.g. see It("Directory with sources").

@netlify
Copy link

netlify bot commented Dec 27, 2022

Deploy Preview for odo-docusaurus-preview ready!

Name Link
🔨 Latest commit a7dd858
🔍 Latest deploy log https://app.netlify.com/sites/odo-docusaurus-preview/deploys/63b6cbda92429100081b8a3b
😎 Deploy Preview https://deploy-preview-6442--odo-docusaurus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@openshift-ci openshift-ci bot added kind/tests area/documentation Issues or PRs related to documentation or the 'odo.dev' website labels Dec 27, 2022
@openshift-ci openshift-ci bot requested review from feloy and rm3l December 27, 2022 15:48
@odo-robot
Copy link

odo-robot bot commented Dec 27, 2022

OpenShift Tests on commit edcd9f7 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Dec 27, 2022

Validate Tests on commit edcd9f7 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Dec 27, 2022

NoCluster Tests on commit edcd9f7 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Dec 27, 2022

Unit Tests on commit edcd9f7 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Dec 27, 2022

Kubernetes Tests on commit edcd9f7 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Dec 27, 2022

Windows Tests (OCP) on commit edcd9f7 finished successfully.
View logs: TXT HTML

Copy link
Contributor

@feloy feloy left a comment

Choose a reason for hiding this comment

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

Great work @valaparthvi
Just a few comment, to try and make it more maintainable

helper.SetDefaultDevfileRegistryAsStaging()
})

removePreferenceKeys := func(docString string) (returnString string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems too much specific to me. It would be nice to have a mechanism to have [...] in the MDX file match any number of lines in the output, so thsi could be reused for other tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had a similar thought, but there aren't many mdx/md files at present that use [...], so I decide to be more specific. I would prefer to iterate over this when the need arises.

Copy link
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

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

@valaparthvi I'm trying to run the Make target, but no Spec ran. Am I missing something?

$ make test-doc-automation
go run -mod=vendor github.com/onsi/ginkgo/v2/ginkgo --junit-report=.tmp/junit-report.xml --randomize-all --slow-spec-threshold=120s -timeout 14400s --no-color -nodes=8 --junit-report="test-doc-automation.xml"  tests/documentation
=== RUN   TestDocAutomation
Running Suite: Doc Automation Suite - /home/asoro/work/projects/odo/tests/documentation
=======================================================================================
Random Seed: 1672759310

Will run 0 of 0 specs

Ran 0 of 0 Specs in 0.000 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestDocAutomation (0.00s)
PASS

Ginkgo ran 1 suite in 5.359164652s
Test Suite Passed

@valaparthvi
Copy link
Contributor Author

@valaparthvi I'm trying to run the Make target, but no Spec ran. Am I missing something?

$ make test-doc-automation
go run -mod=vendor github.com/onsi/ginkgo/v2/ginkgo --junit-report=.tmp/junit-report.xml --randomize-all --slow-spec-threshold=120s -timeout 14400s --no-color -nodes=8 --junit-report="test-doc-automation.xml"  tests/documentation
=== RUN   TestDocAutomation
Running Suite: Doc Automation Suite - /home/asoro/work/projects/odo/tests/documentation
=======================================================================================
Random Seed: 1672759310

Will run 0 of 0 specs

Ran 0 of 0 Specs in 0.000 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestDocAutomation (0.00s)
PASS

Ginkgo ran 1 suite in 5.359164652s
Test Suite Passed

No, you're right. I have attempted to fix it, please try it again.

@rm3l
Copy link
Member

rm3l commented Jan 4, 2023

@valaparthvi I'm trying to run the Make target, but no Spec ran. Am I missing something?

$ make test-doc-automation
go run -mod=vendor github.com/onsi/ginkgo/v2/ginkgo --junit-report=.tmp/junit-report.xml --randomize-all --slow-spec-threshold=120s -timeout 14400s --no-color -nodes=8 --junit-report="test-doc-automation.xml"  tests/documentation
=== RUN   TestDocAutomation
Running Suite: Doc Automation Suite - /home/asoro/work/projects/odo/tests/documentation
=======================================================================================
Random Seed: 1672759310

Will run 0 of 0 specs

Ran 0 of 0 Specs in 0.000 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestDocAutomation (0.00s)
PASS

Ginkgo ran 1 suite in 5.359164652s
Test Suite Passed

No, you're right. I have attempted to fix it, please try it again.

👍🏿 It works better now - thanks!

@valaparthvi
Copy link
Contributor Author

/override OpenShift-Integration-tests/OpenShift-Integration-tests

@openshift-ci
Copy link

openshift-ci bot commented Jan 4, 2023

@valaparthvi: Overrode contexts on behalf of valaparthvi: OpenShift-Integration-tests/OpenShift-Integration-tests

In response to this:

/override OpenShift-Integration-tests/OpenShift-Integration-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@valaparthvi valaparthvi requested review from rm3l and feloy January 4, 2023 15:49
@valaparthvi valaparthvi mentioned this pull request Jan 5, 2023
27 tasks
__
/ \__ Initializing a new component
\__/ \
/ \__/ odo version: v3.4.0
Copy link
Contributor

Choose a reason for hiding this comment

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

The test fails when I rebase the branch after bump to 3.5.0.

Could we find a way to include the build/VERSION file in the doc, and proccess the mdx file to resolve the include, before to compare it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, you're right! Let me see what can be done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed in standup, we will manually update the docs right now if they fail. For version, we can update GH action to update it with every release.

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
…r doc automation tests; add documentation for helper functions

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
for tests with specific check

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
…e or let it be

Signed-off-by: Parthvi Vala <pvala@redhat.com>
…s flaky

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Copy link
Contributor

@feloy feloy left a comment

Choose a reason for hiding this comment

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

Great work making the functions more generic. Thanks for this work!
💯
Just a comment about defer, anything else LGTM

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jan 5, 2023
@valaparthvi valaparthvi closed this Jan 5, 2023
@valaparthvi valaparthvi reopened this Jan 5, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.4% 0.4% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Issues or PRs related to documentation or the 'odo.dev' website lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected "docs-mdx" section in the doc sidebar Automate Doc: Command Reference odo init
4 participants