@@ -89,8 +89,44 @@ agentCommandParser =
89
89
$ Box <$> downloadAssetsOptions
90
90
, command " push-test" " Push a test run to Antithesis"
91
91
$ Box <$> pushTestOptions
92
- , command " collect-email- results" " Collect test results from email"
92
+ , command " collect-results-for " " Collect test results from email"
93
93
$ Box <$> emailResultsOptions
94
+ , command " collect-all-results" " Collect all test results from email"
95
+ $ Box <$> emailAllResultsOptions
96
+ ]
97
+
98
+ agentEmailOption :: Parser EmailUser
99
+ agentEmailOption =
100
+ EmailUser
101
+ <$> setting
102
+ [ env " ANTI_AGENT_EMAIL"
103
+ , metavar " EMAIL"
104
+ , help " The agent email to access the results mailbox"
105
+ , reader str
106
+ , long " email-user"
107
+ , option
108
+ ]
109
+ agentEmailPasswordOption :: Parser EmailPassword
110
+ agentEmailPasswordOption =
111
+ EmailPassword
112
+ <$> secretsParser
113
+ " Enter the agent email password to access the mailbox"
114
+ " The agent email password to access the mailbox"
115
+ " ANTI_AGENT_EMAIL_PASSWORD"
116
+ " EMAIL_PASSWORD"
117
+ " ask-agent-email-password"
118
+ " agentEmailPassword"
119
+
120
+ daysOption :: Parser Int
121
+ daysOption =
122
+ setting
123
+ [ long " days"
124
+ , help
125
+ " Number of days in the past to check for test results (default: 7)"
126
+ , metavar " DAYS"
127
+ , reader auto
128
+ , value 7
129
+ , option
94
130
]
95
131
96
132
emailResultsOptions
@@ -99,35 +135,19 @@ emailResultsOptions
99
135
emailResultsOptions =
100
136
CheckResultFor
101
137
<$> tokenIdOption
102
- <*> ( EmailUser
103
- <$> setting
104
- [ env " ANTI_AGENT_EMAIL"
105
- , metavar " EMAIL"
106
- , help " The agent email to access the results mailbox"
107
- , reader str
108
- , long " email-user"
109
- , option
110
- ]
111
- )
112
- <*> ( EmailPassword
113
- <$> secretsParser
114
- " Enter the agent email password to access the mailbox"
115
- " The agent email password to access the mailbox"
116
- " ANTI_AGENT_EMAIL_PASSWORD"
117
- " EMAIL_PASSWORD"
118
- " ask-agent-email-password"
119
- " agentEmailPassword"
120
- )
138
+ <*> agentEmailOption
139
+ <*> agentEmailPasswordOption
121
140
<*> testRunIdOption " check results for"
122
- <*> setting
123
- [ long " days"
124
- , help
125
- " Number of days in the past to check for test results (default: 7)"
126
- , metavar " DAYS"
127
- , reader auto
128
- , value 7
129
- , option
130
- ]
141
+ <*> daysOption
142
+
143
+ emailAllResultsOptions
144
+ :: Parser
145
+ (AgentCommand NotReady (AValidationResult CheckResultsFailure [Result ]))
146
+ emailAllResultsOptions =
147
+ CheckAllResults
148
+ <$> agentEmailOption
149
+ <*> agentEmailPasswordOption
150
+ <*> daysOption
131
151
132
152
pushTestOptions
133
153
:: Parser
0 commit comments