mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Address test cases
This commit is contained in:
parent
bcf55a8492
commit
ca67cd24c8
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
|
@ -18,6 +18,7 @@ jobs:
|
||||||
- uses: ./.github/promci/actions/setup_environment
|
- uses: ./.github/promci/actions/setup_environment
|
||||||
with:
|
with:
|
||||||
enable_npm: true
|
enable_npm: true
|
||||||
|
- run: make GOOPTS=--tags=stringlabels GO_ONLY=1 SKIP_GOLANGCI_LINT=1
|
||||||
- run: go test --tags=stringlabels ./tsdb/ -test.tsdb-isolation=false
|
- run: go test --tags=stringlabels ./tsdb/ -test.tsdb-isolation=false
|
||||||
- run: make -C documentation/examples/remote_storage
|
- run: make -C documentation/examples/remote_storage
|
||||||
- run: make -C documentation/examples
|
- run: make -C documentation/examples
|
||||||
|
@ -176,6 +177,25 @@ jobs:
|
||||||
go-version: 1.23.x
|
go-version: 1.23.x
|
||||||
- name: Run goyacc and check for diff
|
- name: Run goyacc and check for diff
|
||||||
run: make install-goyacc check-generated-parser
|
run: make install-goyacc check-generated-parser
|
||||||
|
golangci:
|
||||||
|
name: golangci-lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||||
|
with:
|
||||||
|
go-version: 1.23.x
|
||||||
|
- name: Install snmp_exporter/generator dependencies
|
||||||
|
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
|
||||||
|
if: github.repository == 'prometheus/snmp_exporter'
|
||||||
|
- name: Lint
|
||||||
|
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
|
||||||
|
with:
|
||||||
|
args: --verbose
|
||||||
|
# Make sure to sync this with Makefile.common and scripts/golangci-lint.yml.
|
||||||
|
version: v1.60.2
|
||||||
fuzzing:
|
fuzzing:
|
||||||
uses: ./.github/workflows/fuzzing.yml
|
uses: ./.github/workflows/fuzzing.yml
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
|
|
|
@ -343,19 +343,22 @@ func TestSelectHintsSetCorrectly(t *testing.T) {
|
||||||
{Start: -3999, End: 1000},
|
{Start: -3999, End: 1000},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// TODO: Add them back {
|
// TODO: Testcases are modified to make sure they passes parallel AST parsing
|
||||||
// query: "foo[2m]", start: 200000,
|
{query: "foo[2m]", start: 200000,
|
||||||
// expected: []*storage.SelectHints{
|
expected: []*storage.SelectHints{
|
||||||
// {Start: 80001, End: 200000, Range: 120000},
|
{Start: 195001, End: 200000, Range: 0},
|
||||||
// },
|
},
|
||||||
//},
|
}, {
|
||||||
{
|
query: "foo[2m] offset 2m", start: 300000,
|
||||||
|
expected: []*storage.SelectHints{
|
||||||
|
{Start: 175001, End: 180000, Range: 0},
|
||||||
|
},
|
||||||
|
}, {
|
||||||
query: "foo[2m] @ 180", start: 200000,
|
query: "foo[2m] @ 180", start: 200000,
|
||||||
expected: []*storage.SelectHints{
|
expected: []*storage.SelectHints{
|
||||||
{Start: 60001, End: 180000, Range: 120000},
|
{Start: 60001, End: 180000, Range: 120000},
|
||||||
},
|
},
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
query: "foo[2m] @ 300", start: 200000,
|
query: "foo[2m] @ 300", start: 200000,
|
||||||
expected: []*storage.SelectHints{
|
expected: []*storage.SelectHints{
|
||||||
{Start: 180001, End: 300000, Range: 120000},
|
{Start: 180001, End: 300000, Range: 120000},
|
||||||
|
@ -366,12 +369,6 @@ func TestSelectHintsSetCorrectly(t *testing.T) {
|
||||||
{Start: -59999, End: 60000, Range: 120000},
|
{Start: -59999, End: 60000, Range: 120000},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
//{
|
|
||||||
// query: "foo[2m] offset 2m", start: 300000,
|
|
||||||
// expected: []*storage.SelectHints{
|
|
||||||
// {Start: 60001, End: 180000, Range: 120000},
|
|
||||||
// },
|
|
||||||
//},
|
|
||||||
{
|
{
|
||||||
query: "foo[2m] @ 200 offset 2m", start: 300000,
|
query: "foo[2m] @ 200 offset 2m", start: 300000,
|
||||||
expected: []*storage.SelectHints{
|
expected: []*storage.SelectHints{
|
||||||
|
|
Loading…
Reference in a new issue