(t *testing.T)
| 718 | } |
| 719 | |
| 720 | func TestParseQueryRequestInvalidBounds(t *testing.T) { |
| 721 | tests := []struct { |
| 722 | name string |
| 723 | params map[string]string |
| 724 | errMsg string |
| 725 | }{ |
| 726 | { |
| 727 | name: "invalid start", |
| 728 | params: map[string]string{"q": "{} | rate()", "start": "abc", "end": "1700000000"}, |
| 729 | errMsg: "could not parse 'start' parameter", |
| 730 | }, |
| 731 | { |
| 732 | name: "invalid end", |
| 733 | params: map[string]string{"q": "{} | rate()", "start": "1700000000", "end": "bca"}, |
| 734 | errMsg: "could not parse 'end' parameter", |
| 735 | }, |
| 736 | } |
| 737 | |
| 738 | for _, tt := range tests { |
| 739 | t.Run("range/"+tt.name, func(t *testing.T) { |
| 740 | r := makeReq(tt.params) |
| 741 | _, err := ParseQueryRangeRequest(r) |
| 742 | require.Error(t, err) |
| 743 | assert.Contains(t, err.Error(), tt.errMsg) |
| 744 | }) |
| 745 | |
| 746 | t.Run("instant/"+tt.name, func(t *testing.T) { |
| 747 | r := makeReq(tt.params) |
| 748 | _, err := ParseQueryInstantRequest(r) |
| 749 | require.Error(t, err) |
| 750 | assert.Contains(t, err.Error(), tt.errMsg) |
| 751 | }) |
| 752 | } |
| 753 | } |
| 754 | |
| 755 | func TestQueryRangeRoundtripEmpty(t *testing.T) { |
| 756 | req := &tempopb.QueryRangeRequest{ |
nothing calls this directly
no test coverage detected