pnp / pnp/cli-microsoft365

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

Open
#6,497 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted keep-open
Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the spfx project azuredevops pipeline add and spfx project github workflow add command entry points and review their linked documentation. Add the optional -t, --runTests behavior so the generated workflows run gulp test before bundling, then verify both generated step formats and their command help or documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, github-actions, typescript
Domain
build-system, cli, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.