github.com/kubeshop/testkube@v1.17.23/contrib/executor/postman/pkg/runner/newman/metadata.go (about)

     1  // struct autogenerated from output file
     2  // some fields could be missing
     3  // example command newman run jw1.postman_collection.json --reporters cli,json --reporter-json-export outputfile.json
     4  package newman
     5  
     6  type ExecutionJSONResult struct {
     7  	Collection  Collection  `json:"collection"`
     8  	Environment Environment `json:"environment"`
     9  	Globals     Globals     `json:"globals"`
    10  	Run         Run         `json:"run"`
    11  }
    12  
    13  type Collection struct {
    14  	Metadata struct {
    15  		PostmanID string `json:"postman_id"`
    16  	} `json:"_"`
    17  	Item     []Item        `json:"item"`
    18  	Event    []interface{} `json:"event"`
    19  	Variable []interface{} `json:"variable"`
    20  	Info     Info          `json:"info"`
    21  }
    22  
    23  type Environment struct {
    24  	ID     string        `json:"id"`
    25  	Values []interface{} `json:"values"`
    26  }
    27  
    28  type Globals struct {
    29  	ID     string        `json:"id"`
    30  	Values []interface{} `json:"values"`
    31  }
    32  
    33  type Info struct {
    34  	PostmanID string `json:"_postman_id"`
    35  	Name      string `json:"name"`
    36  	Schema    string `json:"schema"`
    37  }
    38  
    39  type Item struct {
    40  	ID       string        `json:"id"`
    41  	Name     string        `json:"name"`
    42  	Request  Request       `json:"request"`
    43  	Response []interface{} `json:"response"`
    44  	Event    []Event       `json:"event"`
    45  }
    46  
    47  type Event struct {
    48  	Listen string `json:"listen"`
    49  	Script struct {
    50  		ID              string   `json:"id"`
    51  		Type            string   `json:"type"`
    52  		Exec            []string `json:"exec"`
    53  		LastExecutionID string   `json:"_lastExecutionId"`
    54  	} `json:"script"`
    55  }
    56  type Run struct {
    57  	Stats      RunStats    `json:"stats"`
    58  	Timings    RunTimings  `json:"timings"`
    59  	Executions []Execution `json:"executions"`
    60  	Transfers  struct {
    61  		ResponseTotal int `json:"responseTotal"`
    62  	} `json:"transfers"`
    63  	Failures []Failure `json:"failures"`
    64  	Error    *RunError `json:"error,omitempty"`
    65  }
    66  
    67  type RunTimings struct {
    68  	ResponseAverage  float64 `json:"responseAverage"`
    69  	ResponseMin      int     `json:"responseMin"`
    70  	ResponseMax      int     `json:"responseMax"`
    71  	ResponseSd       float64 `json:"responseSd"`
    72  	DNSAverage       int     `json:"dnsAverage"`
    73  	DNSMin           int     `json:"dnsMin"`
    74  	DNSMax           int     `json:"dnsMax"`
    75  	DNSSd            int     `json:"dnsSd"`
    76  	FirstByteAverage int     `json:"firstByteAverage"`
    77  	FirstByteMin     int     `json:"firstByteMin"`
    78  	FirstByteMax     int     `json:"firstByteMax"`
    79  	FirstByteSd      int     `json:"firstByteSd"`
    80  	Started          int64   `json:"started"`
    81  	Completed        int64   `json:"completed"`
    82  }
    83  
    84  type RunError struct {
    85  	Name    string `json:"name"`
    86  	Index   int    `json:"index"`
    87  	Test    string `json:"test"`
    88  	Message string `json:"message"`
    89  	Stack   string `json:"stack"`
    90  }
    91  
    92  type Failure struct {
    93  	Error  FailureError `json:"error"`
    94  	At     string       `json:"at"`
    95  	Source struct {
    96  		ID      string `json:"id"`
    97  		Name    string `json:"name"`
    98  		Request struct {
    99  			URL struct {
   100  				Protocol string        `json:"protocol"`
   101  				Path     []string      `json:"path"`
   102  				Host     []string      `json:"host"`
   103  				Query    []interface{} `json:"query"`
   104  				Variable []interface{} `json:"variable"`
   105  			} `json:"url"`
   106  			Method string `json:"method"`
   107  		} `json:"request"`
   108  		Response []interface{} `json:"response"`
   109  		Event    []struct {
   110  			Listen string `json:"listen"`
   111  			Script struct {
   112  				ID              string   `json:"id"`
   113  				Type            string   `json:"type"`
   114  				Exec            []string `json:"exec"`
   115  				LastExecutionID string   `json:"_lastExecutionId"`
   116  			} `json:"script"`
   117  		} `json:"event"`
   118  	} `json:"source"`
   119  	Parent struct {
   120  		Metadata struct {
   121  			PostmanID string `json:"postman_id"`
   122  		} `json:"_"`
   123  		Item []struct {
   124  			ID      string `json:"id"`
   125  			Name    string `json:"name"`
   126  			Request struct {
   127  				URL struct {
   128  					Protocol string        `json:"protocol"`
   129  					Path     []string      `json:"path"`
   130  					Host     []string      `json:"host"`
   131  					Query    []interface{} `json:"query"`
   132  					Variable []interface{} `json:"variable"`
   133  				} `json:"url"`
   134  				Method string `json:"method"`
   135  			} `json:"request"`
   136  			Response []interface{} `json:"response"`
   137  			Event    []struct {
   138  				Listen string `json:"listen"`
   139  				Script struct {
   140  					ID              string   `json:"id"`
   141  					Type            string   `json:"type"`
   142  					Exec            []string `json:"exec"`
   143  					LastExecutionID string   `json:"_lastExecutionId"`
   144  				} `json:"script"`
   145  			} `json:"event"`
   146  		} `json:"item"`
   147  		Event    []interface{} `json:"event"`
   148  		Variable []interface{} `json:"variable"`
   149  		Info     struct {
   150  			PostmanID string `json:"_postman_id"`
   151  			Name      string `json:"name"`
   152  			Schema    string `json:"schema"`
   153  		} `json:"info"`
   154  	} `json:"parent"`
   155  	Cursor struct {
   156  		Position      int    `json:"position"`
   157  		Iteration     int    `json:"iteration"`
   158  		Length        int    `json:"length"`
   159  		Cycles        int    `json:"cycles"`
   160  		Empty         bool   `json:"empty"`
   161  		EOF           bool   `json:"eof"`
   162  		Bof           bool   `json:"bof"`
   163  		Cr            bool   `json:"cr"`
   164  		Ref           string `json:"ref"`
   165  		HTTPRequestID string `json:"httpRequestId"`
   166  		ScriptID      string `json:"scriptId"`
   167  		Execution     string `json:"execution"`
   168  	} `json:"cursor"`
   169  }
   170  
   171  type FailureError struct {
   172  	Name       string `json:"name"`
   173  	Index      int    `json:"index"`
   174  	Test       string `json:"test"`
   175  	Message    string `json:"message"`
   176  	Stack      string `json:"stack"`
   177  	Checksum   string `json:"checksum"`
   178  	ID         string `json:"id"`
   179  	Timestamp  int64  `json:"timestamp"`
   180  	Stacktrace []struct {
   181  		FileName     string `json:"fileName"`
   182  		LineNumber   int    `json:"lineNumber"`
   183  		FunctionName string `json:"functionName"`
   184  		TypeName     string `json:"typeName"`
   185  		MethodName   string `json:"methodName"`
   186  		ColumnNumber int    `json:"columnNumber"`
   187  		Native       bool   `json:"native"`
   188  	} `json:"stacktrace"`
   189  }
   190  type Execution struct {
   191  	Cursor     ExecutionCursor `json:"cursor,omitempty"`
   192  	Item       Item            `json:"item"`
   193  	Request    Request         `json:"request"`
   194  	Response   Response        `json:"response"`
   195  	ID         string          `json:"id"`
   196  	Assertions []Assertion     `json:"assertions"`
   197  }
   198  
   199  type Assertion struct {
   200  	Assertion string    `json:"assertion"`
   201  	Skipped   bool      `json:"skipped"`
   202  	Error     *RunError `json:"error,omitempty"`
   203  }
   204  
   205  type Request struct {
   206  	URL struct {
   207  		Protocol string        `json:"protocol"`
   208  		Path     []string      `json:"path"`
   209  		Host     []string      `json:"host"`
   210  		Query    []interface{} `json:"query"`
   211  		Variable []interface{} `json:"variable"`
   212  	} `json:"url"`
   213  	Header []struct {
   214  		Key    string `json:"key"`
   215  		Value  string `json:"value"`
   216  		System bool   `json:"system"`
   217  	} `json:"header"`
   218  	Method string `json:"method"`
   219  }
   220  
   221  type Response struct {
   222  	ID     string `json:"id"`
   223  	Status string `json:"status"`
   224  	Code   int    `json:"code"`
   225  	Header []struct {
   226  		Key   string `json:"key"`
   227  		Value string `json:"value"`
   228  	} `json:"header"`
   229  	Stream struct {
   230  		Type string `json:"type"`
   231  		Data []int  `json:"data"`
   232  	} `json:"stream"`
   233  	Cookie       []interface{} `json:"cookie"`
   234  	ResponseTime int           `json:"responseTime"`
   235  	ResponseSize int           `json:"responseSize"`
   236  }
   237  type ExecutionCursor struct {
   238  	Position      int    `json:"position"`
   239  	Iteration     int    `json:"iteration"`
   240  	Length        int    `json:"length"`
   241  	Cycles        int    `json:"cycles"`
   242  	Empty         bool   `json:"empty"`
   243  	EOF           bool   `json:"eof"`
   244  	Bof           bool   `json:"bof"`
   245  	Cr            bool   `json:"cr"`
   246  	Ref           string `json:"ref"`
   247  	HTTPRequestID string `json:"httpRequestId"`
   248  }
   249  
   250  type RunStats struct {
   251  	Iterations        Stat `json:"iterations"`
   252  	Items             Stat `json:"items"`
   253  	Scripts           Stat `json:"scripts"`
   254  	Prerequests       Stat `json:"prerequests"`
   255  	Requests          Stat `json:"requests"`
   256  	Tests             Stat `json:"tests"`
   257  	Assertions        Stat `json:"assertions"`
   258  	TestScripts       Stat `json:"testScripts"`
   259  	PrerequestScripts Stat `json:"prerequestScripts"`
   260  }
   261  type Stat struct {
   262  	Total   int `json:"total"`
   263  	Pending int `json:"pending"`
   264  	Failed  int `json:"failed"`
   265  }