Skip to content

Commit

Permalink
refactor: zunit tests & gh-r logic (#201)
Browse files Browse the repository at this point in the history
- Ability to run unit tests without Docker
- Define a Z-unit \_support/bootstrap script defining the isolated test
  environment in a temp dir via `mktemp -d`, to ensure a clean test
  environment.
- GH actions workflow now tests macOS & Windows and bumps Ubuntu to the
  latest.
- GH actions workflow leverages Homebrew to simplify installing zsh &
  zunit
- Condense Z-unit GH workflow into more organized build matrix. It
  avoids creating a new environment per test file as some test files
  only have one or two tests.
- Change or remove logic in the `setup` and `teardown` functions to
  commands which apply to type of tests being run (e.g., `gh-r` setup
  sets defualt ice `gh-r` and `nocompile`).
- Expand tests for testing `gh-r` on Linux & macOS for ensuring correct
  release selection.
- Correct GH workflow `on` conditions to avoid duplicating jobs.
- Update `gh-r` ice logic to be smarter about selecting a release for
  the current system.
- Expand linting to include the tools `shfmt`, `shellcheck`, and
  `mdformat`
- Rudimentary testing for all Zinit annexes (e.g., install with no
  errors)

|   Test   | Before | Now |
| :------: | :----: | :-: |
| annexes  |   3    | 10  |
|   gh-r   |   3    | 95  |
| plugins  |   2    |  3  |
| snippets |   4    |  4  |

<img width="841" alt="Screen Shot 2022-04-23 at 21 57 08" src="https://user-images.githubusercontent.com/10052309/164954220-123a8dc5-0399-41e3-b9cf-98b2cf599145.png">

Signed-off-by: Vladislav Doster <[email protected]>
  • Loading branch information
vladdoster committed Apr 24, 2022
1 parent 537e895 commit d59f150
Show file tree
Hide file tree
Showing 28 changed files with 1,293 additions and 711 deletions.
83 changes: 55 additions & 28 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,80 @@
name: "🐞 Bug report"
description: File a bug report
labels: ["🐞 bug", "🎲 triage"]
title: "🐞 bug: "
name: Report a bug
description: Report a bug that isn't caused by Zinit. If unsure, use this form
body:

- type: markdown
attributes:
value: |
## Self Check
- Look for similar errors in existing [GitHub Issues](https://github.com/zdharma-continuum/zinit/issues?q=is%3Aissue) (open or closed).
- Try reaching out on the [Gitter server](https://gitter.im/zdharma-continuum/community/) for help.
- type: textarea
id: description
validations:
required: true
attributes:
label: Issue description
description: What went wrong?
label: Describe the bug
description: A clear description of what the bug is.

- type: textarea
validations:
required: true
attributes:
label: Steps to reproduce
description: |
Steps to reproduce the problem.
placeholder: |
For example:
1. Enable plugin '...'
2. Run command '...' or try to complete command '...'
3. See error
- type: textarea
id: zinit-config
validations:
required: true
attributes:
label: zinit config
description: The ices you used
value: |
```zsh
zinit \
null \
atclone'true' \
for zdharma_continuum/null
```
label: Expected behavior
description: A brief description of what should happen.

- type: textarea
attributes:
label: Screenshots and recordings
description: |
If applicable, add screenshots to help explain your problem. You can also record an asciinema session: https://asciinema.org/
- type: input
id: zinit-version
validations:
required: true
attributes:
label: 'zinit version or commit ID'
description: '`git -C $ZINIT[BIN_DIR] rev-list --max-count=1 HEAD`'
placeholder: "7cd8768de45fb7e1f98bbe90a961674b38fa247d"
label: OS / Linux distribution
placeholder: |
Add output of the following command:
`echo "$OSTYPE $VENDOR $MACHTYPE $CPUTYPE $(uname -m -p)`
- type: input
id: zsh-version
validations:
required: true
attributes:
label: zsh version
description: "ZSH version you're currently using: `echo $ZSH_VERSION`"
placeholder: "5.8"
label: Zsh version
description: Run `echo $ZSH_VERSION` to check.
placeholder: "5.6"

- type: input
id: host-info
validations:
required: true
attributes:
label: host info
description: "`typeset -m '*TYPE'; uname --kernel-release; grep -E '^ID=|^VERSION=' /etc/os-release 2>/dev/null`"
label: Terminal emulator
placeholder: iTerm2, GNOME Terminal, Terminal.app...

- type: dropdown
attributes:
label: If using WSL on Windows, which version of WSL
description: Run `wsl -l -v` to check.
options:
- WSL1
- WSL2

- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here. This can be themes, plugins, custom settings...
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: ❓ GitHub Discussions
- name: Support
url: https://github.com/zdharma-continuum/zinit/discussions
about: Please ask and answer questions here
- name: 💬 Gitter
about: Ask the community for support
- name: Get help on Gitter
url: https://gitter.im/zdharma-continuum/community/
about: Chat with the team
about: Have a quick question? Join the Gitter community and ask your question.
41 changes: 34 additions & 7 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
name: "🎁 Feature request"
description: Request a new feature
labels: ["🎁 feature request", "🎲 triage"]
title: "🎁 Feature request: "
name: Feature request
description: Suggest a feature for Zinit
labels: ["Feature"]
body:
- type: markdown
attributes:
value: |
## Self Check
- Look for similar features in existing [GitHub Issues](https://github.com/zdharma-continuum/zinit/issues?q=is%3Aissue) (open or closed).
- type: input
attributes:
label: If the feature request is for a plugin or theme, specify it here.
description: The name of the plugin or theme that you would like us to improve.
placeholder: e.g. Git plugin, Agnoster theme
- type: textarea
attributes:
label: If the feature solves a problem you have, specify it here.
description: A description of what the problem is.
placeholder: Ex. I'm always frustrated when...
- type: textarea
attributes:
label: Describe the proposed feature.
description: A description of what you want to happen. Be as specific as possible.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A description of any alternative solutions or features you've considered. This can also include other plugins or themes.
- type: textarea
attributes:
label: Additional context
description: Add any other context, screenshots or Gitter conversations about the feature request here. Also if you have any PRs related to this issue that are already open that you would like us to look at.
- type: textarea
id: description
attributes:
label: Feature request
description: Description of the usecase that's currently not supported
label: Related Issues
description: Is there any open or closed issues that is related to this feature request? If so please link them below!
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/proposal.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

<!--- If it fixes an open issue, please link to the issue here. -->

## Usage examples

<!--- Provide examples of intended usage -->

```zsh

```

```zsh

```

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->

<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
52 changes: 0 additions & 52 deletions .github/workflows/documentation.yaml

This file was deleted.

Loading

0 comments on commit d59f150

Please sign in to comment.