You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check that it synchronises the files in the `members-test` directory with the team members of the `actors` team.
43
43
44
-
## `retire.sh`
44
+
## Testing `nomination.sh`
45
+
46
+
This script does not depend on the current repository, but has some external effects.
47
+
For testing, we'll use [PR #33](https://github.com/infinisil-test-org/nixpkgs-committers/pull/33) and [issue #30](https://github.com/infinisil-test-org/nixpkgs-committers/issues/30).
48
+
49
+
To test:
50
+
1. Delete all labels of the PR and reset the title:
51
+
```bash
52
+
gh api --method DELETE /repos/infinisil-test-org/nixpkgs-committers/issues/33/labels
53
+
gh api --method PATCH /repos/infinisil-test-org/nixpkgs-committers/pulls/33 -f title="A non-conforming title"
54
+
```
55
+
1. Run the script while simulating that a non-nomination PR was opened:
56
+
```bash
57
+
scripts/nomination.sh members infinisil-test-org/nixpkgs-committers 33 30 <<<"removed members/infinisil"
58
+
```
59
+
60
+
Ensure that it exits with 0 and wouldn't run any effects.
61
+
1. Run the script while simulating that multiple users were nominated together:
62
+
```bash
63
+
scripts/nomination.sh members infinisil-test-org/nixpkgs-committers 33 30 <<<"removed members/foo"$'\n'"added members/bar"
64
+
```
65
+
66
+
Ensure that it exits with non-0 and wouldn't run any effects.
67
+
1. Run the script simulating a successful nomination
68
+
```bash
69
+
scripts/nomination.sh members infinisil-test-org/nixpkgs-committers 33 30 <<<"added members/infinisil"
70
+
```
71
+
72
+
Ensure that it exits with 0 and would run effects to label the PR, change the title and post a comment in the issue.
73
+
1. Rerun with effects
74
+
```bash
75
+
PROD=1 scripts/nomination.sh members infinisil-test-org/nixpkgs-committers 33 30 <<<"added members/infinisil"
76
+
```
77
+
78
+
## Testing `retire.sh`
45
79
46
80
This script has external effects and as such needs a bit more care when testing.
0 commit comments