Skip to content

docs: Add documentation-test for README#51

Merged
mqasimsarfraz merged 1 commit into
mainfrom
qasim/exec-docs
Nov 10, 2023
Merged

docs: Add documentation-test for README#51
mqasimsarfraz merged 1 commit into
mainfrom
qasim/exec-docs

Conversation

@mqasimsarfraz

Copy link
Copy Markdown
Member

This change add support for testing documentation using exec-docs

@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 12:54 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 13:02 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 13:14 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 13:20 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 13:25 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 13:25 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 13:25 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz force-pushed the qasim/exec-docs branch 2 times, most recently from 46b9131 to ef7febc Compare October 27, 2023 13:31
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 13:37 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 13:42 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 13:42 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 13:42 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 27, 2023 13:48 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz changed the title docs: Add test-docs docs: Add documentation-test Oct 30, 2023
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 30, 2023 09:36 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 30, 2023 09:41 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 30, 2023 09:41 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 30, 2023 09:41 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 30, 2023 09:48 — with GitHub Actions Inactive

@blanquicet blanquicet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking great already!

Comment thread .github/workflows/kubectl-aks.yml Outdated
Comment on lines +272 to +282
- name: Get kubectl-aks from artifact
uses: actions/download-artifact@v3
with:
name: kubectl-aks-linux-amd64-tar-gz
- name: Prepare kubectl-aks binary
shell: bash
run: |
tar zxvf kubectl-aks-linux-amd64.tar.gz
chmod +x kubectl-aks
mv kubectl-aks /usr/local/bin
ls -la

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do you need to install it if it is going to be installed in the README?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I wanted to ensure that the binary that was built in the previous steps of the CI is actually tested since we eventually ship that in the release. But I need to ensure we clean up all other installation for it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yep but currently there is no way to test the README against the just built binary. See my comment in #52 (comment), I think we should separate the README from others docs and the README could only be run for the releases (which makes sense as it describes how to install a released version). WDYT?

@mqasimsarfraz mqasimsarfraz Oct 30, 2023

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

currently there is no way to test the README against the just built binary

I realized it is possible to pass env vars to ie so it can be used to add custom directory to PATH like I did here. This takes care of using the built binary by adding path of the current directory where kubectl-aks (built by kubectl-aks target) is located. In the CI, kubectl-aks is download at correct location and used by the tests. Shouldn't that cover all the cases?

Edit: Need to ensure binaries at different path are used in expected order 🤔

@blanquicet blanquicet Oct 31, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think it covers also the README case as it doesn't make sense to run kubectl krew install aks (which install kubectl-aks in ~/.krew/bin/ and then run kubectl aks version using the binary we compiled in the build CI job.

Then, for the commands documentation, we could use such method. However, I expect to have just one binary at that time given that we are cleaning up everything we install in the README. So, the only binary available in that host will be the one we downloaded from the artifacts.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think it covers also the README case as it doesn't make sense to run kubectl krew install aks (which install kubectl-aks in ~/.krew/bin/ and then run kubectl aks version using the binary we compiled in the build CI job.

Thanks for catching this. I defined the precedence now krew > local > current directory and it is working as expected krew version, specific version, installed from source. This also ensures the kubectl aks --help is tested against the binary from the PR so any issues will be caught right away.

So, the only binary available in that host will be the one we downloaded from the artifacts.

Yeah, I think for commands testing, it is much simpler. I feel like with above we should be fine for README.md but I am happy to test it separately. What do you say?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I still find it too hacky. Now that you added the cleanup step for all the installation methods, I don't see the need of passing the list of paths in a specific order, there will always be only one binary installed at a time.

The only remaining problem is the kubectl aks help.... Mmmm I'm not sure what to do. We could either use ./kubectl-aks help or remove it as the list of commands are already describe above in the documentation.

What do you think?

Comment thread .github/workflows/kubectl-aks.yml Outdated
Comment thread README.md Outdated
Comment thread README.md
Comment thread .gitignore Outdated
*.exe~
*.dll
*.so
*.log

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this file generated by the ie? I haven't noticed it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, for me. I am getting ie.log once running it. Maybe it is only written if something fails?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know. Please keep track of this things so that we can provide feedback to the InnovationEngine project.

@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 30, 2023 17:26 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 30, 2023 17:33 — with GitHub Actions Inactive
Base automatically changed from qasim/parallel-tests to main October 30, 2023 17:33
@blanquicet blanquicet changed the title docs: Add documentation-test docs: Add documentation-test for README Oct 30, 2023
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 30, 2023 17:37 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 30, 2023 17:37 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 30, 2023 17:37 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks October 30, 2023 17:44 — with GitHub Actions Inactive
Comment thread .github/workflows/kubectl-aks.yml Outdated
Comment thread .github/workflows/kubectl-aks.yml
Comment thread Makefile Outdated
Comment thread README.md Outdated
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks November 1, 2023 09:02 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks November 1, 2023 09:08 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks November 1, 2023 09:08 — with GitHub Actions Inactive
@mqasimsarfraz mqasimsarfraz temporarily deployed to aks November 1, 2023 09:08 — with GitHub Actions Inactive
Comment thread .github/workflows/kubectl-aks.yml
Comment thread ie.mk Outdated
Comment thread .github/workflows/kubectl-aks.yml Outdated
Comment on lines +272 to +282
- name: Get kubectl-aks from artifact
uses: actions/download-artifact@v3
with:
name: kubectl-aks-linux-amd64-tar-gz
- name: Prepare kubectl-aks binary
shell: bash
run: |
tar zxvf kubectl-aks-linux-amd64.tar.gz
chmod +x kubectl-aks
mv kubectl-aks /usr/local/bin
ls -la

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I still find it too hacky. Now that you added the cleanup step for all the installation methods, I don't see the need of passing the list of paths in a specific order, there will always be only one binary installed at a time.

The only remaining problem is the kubectl aks help.... Mmmm I'm not sure what to do. We could either use ./kubectl-aks help or remove it as the list of commands are already describe above in the documentation.

What do you think?

@mqasimsarfraz

Copy link
Copy Markdown
Member Author

The only remaining problem is the kubectl aks help.... Mmmm I'm not sure what to do. We could either use ./kubectl-aks help or remove it as the list of commands are already describe above in the documentation.

I agree. It does look hacky. I removed testing it for now. We can reflect back later on if there is a nicer way to do it. Thanks for all the feedback. I updated the PR.

@blanquicet blanquicet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks for working on this.

Comment thread README.md
This change add support for testing documentation
using exec-docs

Signed-off-by: Qasim Sarfraz <qasimsarfraz@microsoft.com>
@mqasimsarfraz

Copy link
Copy Markdown
Member Author

Thanks for reviews! CI is green! I will merge this!

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