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

Update the azuredevops pipeline add and github workflow add with option to scaffold running tests step #6497

Open
Adam-it opened this issue Nov 18, 2024 · 3 comments

Comments

@Adam-it
Copy link
Member

Adam-it commented Nov 18, 2024

Currently the spfx project azuredevops pipeline add and spfx project github workflow add will scaffold a perfectly good workflow which builds, packages and deploys the SPFx project.
One thing which is missing is running tests. This is also a usual thing we do in our deployment pipelines which is a good practice to include as a safety check before something will get deployed. Of course, if we have tests in our SPFx project 😜.

So my idea is to a new option
-t, --runTests - flag, when included in the command it will also scaffold a step that will run gulp test

for Azure DevOps it should add a step like

- task: Gulp@0
            displayName: Gulp test
            inputs:
              targets: test

before the bundle task.

and for GitHub workflow it could be something like

- name: Bundle & Package
        run: |
          gulp test
@Adam-it
Copy link
Member Author

Adam-it commented Nov 27, 2024

@pnp/cli-for-microsoft-365-maintainers any feed on this one?
@martinlingstuyl I know you are DevOps kinda of guy maybe you have any comments?

@martinlingstuyl
Copy link
Contributor

Seems fine with me @Adam-it, I don't generally build tests for SPFx, but i think it's a good idea as a default to add, as SPFx also includes this task by default.

@Adam-it Adam-it added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels Nov 27, 2024
@Adam-it
Copy link
Member Author

Adam-it commented Nov 27, 2024

Let's open it up 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants