netlify / build

Netlify Build (node process) runs the build command, Build Plugins and bundles Netlify Functions. Can be run in Buildbot or locally using Netlify CLI
https://docs.netlify.com/configure-builds/build-plugins/
MIT License
217 stars 55 forks source link

Improve tests for the `git` utility #2013

Closed ehmicky closed 1 year ago

ehmicky commented 3 years ago

The git utility uses the git binary to retrieve some repository information and expose them to Build plugins. In order to unit test this, we are currently targeting a very old commit in @netlify/build.

https://github.com/netlify/build/blob/6621f9d44dd211f6ce3713a0319b08b1dcc59d7b/packages/git-utils/tests/main.js#L7-L12

Instead, we should create a fake .git repository at test-time, then clean it up after the tests exit.

When this happens, we can remove fetch-depth: 0 from GitHub actions.

https://github.com/netlify/build/blob/605ed38cc9771794489d5ec714b125e3a82c3d64/.github/workflows/workflow.yml#L24-L27

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had activity in 1 year. It will be closed in 14 days if no further activity occurs. Thanks!

github-actions[bot] commented 1 year ago

This issue was closed because it had no activity for over 1 year.