Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(draft_scli_yaml_v2): minimal prototype of the automated test results CLI command #1497

Closed
wants to merge 5 commits into from

Conversation

pranav-new-relic
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #1497 (49ab03a) into main (98916a5) will decrease coverage by 0.77%.
Report is 1 commits behind head on main.
The diff coverage is 5.29%.

@@            Coverage Diff             @@
##             main    #1497      +/-   ##
==========================================
- Coverage   47.85%   47.08%   -0.77%     
==========================================
  Files         122      123       +1     
  Lines        7435     7609     +174     
==========================================
+ Hits         3558     3583      +25     
- Misses       3736     3885     +149     
  Partials      141      141              
Files Changed Coverage Δ
internal/synthetics/command_batch_run.go 5.29% <5.29%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@NSSPKrishna
Copy link
Member

Note to self:

  • revamping spinner similar to our install flow.
  • tests for batch configs

Comment on lines +62 to +75
const (
AutomatedTestResultsExitStatusSuccess AutomatedTestResultsExitStatus = 0
AutomatedTestResultsExitStatusFailure AutomatedTestResultsExitStatus = 1
AutomatedTestResultsExitStatusTimedOut AutomatedTestResultsExitStatus = 3
AutomatedTestResultsExitStatusUnknown AutomatedTestResultsExitStatus = 2
)

type AutomatedTestResultsStatus string

const (
AutomatedTestResultsStatusPassed AutomatedTestResultsStatus = "PASSED"
AutomatedTestResultsStatusFailure AutomatedTestResultsStatus = "FAILED"
AutomatedTestResultsStatusTimedOut AutomatedTestResultsStatus = "TIMED_OUT"
AutomatedTestResultsStatusInProgress AutomatedTestResultsStatus = "IN_PROGRESS"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could be used to create a map AutomatedTestResultsStatus: AutomatedTestResultsExitStatus

e.g. something like this

var SyntheticsTestResultExitCodes = map[AutomatedTestResultsStatus]AutomatedTestResultsExitStatus{
	AutomatedTestResultsStatusPassed: AutomatedTestResultsExitStatusSuccess,
	AutomatedTestResultsStatusFailure: AutomatedTestResultsExitStatusFailure,
	AutomatedTestResultsStatusTimedOut: AutomatedTestResultsExitStatusTimedOut,
	AutomatedTestResultsStatusInProgress: AutomatedTestResultsExitStatusUnknown,
}

This could remove the need for using a switch statement and instead we could access the map directly to capture the exit code.

@pranav-new-relic
Copy link
Member Author

Closing this PR since it is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants