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.
47
81
@@ -76,7 +110,7 @@ The following sequence tests all code paths:
76
110
```
77
111
78
112
Check that no PR would be opened.
79
-
2. Run the script with the `empty` repo argument to simulate CI running with inactive users:
113
+
1. Run the script with the `empty` repo argument to simulate CI running with inactive users:
80
114
81
115
```bash
82
116
scripts/retire.sh infinisil-test-org empty nixpkgs-committers members-test 'yesterday 1 month ago' now
@@ -90,27 +124,27 @@ The following sequence tests all code paths:
90
124
91
125
Check that it created the PR appropriately, including assigning the "retirement" label.
92
126
You can undo this step by closing the PR.
93
-
3. Run it again to simulate CI running again later:
127
+
1. Run it again to simulate CI running again later:
0 commit comments