Skip to content

Test Suite Using Ginkgo - #7

Open
afzal-qxip wants to merge 18 commits into
metrico:mainfrom
afzal-qxip:feat/go-testsuit
Open

Test Suite Using Ginkgo#7
afzal-qxip wants to merge 18 commits into
metrico:mainfrom
afzal-qxip:feat/go-testsuit

Conversation

@afzal-qxip

Copy link
Copy Markdown

Implementation for #6

@rita7lopes rita7lopes linked an issue May 7, 2025 that may be closed by this pull request
Comment thread .idea/codeStyles/Project.xml Outdated
Comment thread e2e_tests/common.go Outdated
Comment thread e2e_tests/common.go Outdated
Comment thread e2e_tests/common.go Outdated
Comment thread e2e_tests/common.go Outdated
Comment thread e2e_tests/e2e.logql.reader.go Outdated
Comment thread e2e_tests/e2e.logql.reader.go Outdated
Comment thread e2e_tests/e2e.logql.reader.go
Comment thread e2e_tests/e2e.logql.reader.go Outdated
Comment thread e2e_tests/e2e.logql.reader.go
Comment thread e2e_tests/common.go Outdated
Comment thread e2e_tests/e2e.logql.reader.go
Comment thread e2e_tests/e2e.logql.reader.go
Comment thread e2e_tests/e2e.logql.reader.go
Comment thread e2e_tests/e2e.logql.reader.go
Comment thread e2e_tests/e2e.logql.reader.go Outdated
Comment thread e2e_tests/e2e.logql.reader.go Outdated
Comment thread e2e_tests/e2e.logql.reader.go
Comment thread e2e_tests/e2e.logql.reader.go
Comment thread e2e_tests/e2e.logql.reader.go
data
(struct { ResultType string "json:\"resultType\""; Result []e2e_tests.MatrixResult "json:\"result\"" }) {
ResultType: (string) (len=6) "matrix",
Result: ([]e2e_tests.MatrixResult) <nil>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pretty much all the tests have Result: ([]e2e_tests.MatrixResult) <nil> . That's wrong. The result should be non-nil

var seriesResp SeriesResponse
err = json.Unmarshal(body, &seriesResp)
Expect(err).NotTo(HaveOccurred())
err = cupaloy.New().SnapshotMulti(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This snapshot should be for the response body as well. Not just for status.

Expect(err).NotTo(HaveOccurred())

Expect(resp.StatusCode).To(Equal(200))
err = cupaloy.New().SnapshotMulti(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This snapshot should be for the response body as well. Not just for status.

resp, err := runRequest(fmt.Sprintf(`{test_id="%s"} | freq > 1 and (freq="4" or freq==2 or freq > 0.5)`, testID), 0, 0, 0, "", 0)
Expect(err).NotTo(HaveOccurred())
adjustResult(resp, "", 0)
err = cupaloy.New().SnapshotMulti(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This snapshot should be for the response body as well. Not just for status.

Expect(err).NotTo(HaveOccurred())
adjustResult(resp, "", 0)
err = cupaloy.New().SnapshotMulti(
"status", resp.Status,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This snapshot should be for the response body as well. Not just for status.

Comment thread e2e_tests/misc_test.go Outdated
Expect(err).ToNot(HaveOccurred())
defer resp.Body.Close()
Expect(resp.StatusCode).To(Equal(200))
err = cupaloy.New().SnapshotMulti(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove this snapshot check.

Comment thread e2e_tests/misc_test.go Outdated
Expect(err).ToNot(HaveOccurred())
defer resp.Body.Close()
Expect(resp.StatusCode).To(Equal(200))
err = cupaloy.New().SnapshotMulti(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove this snapshot check.

Comment thread e2e_tests/misc_test.go Outdated
Expect(err).ToNot(HaveOccurred())
defer resp.Body.Close()
Expect(resp.StatusCode).To(Equal(200))
err = cupaloy.New().SnapshotMulti(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove this snapshot check.

Comment thread e2e_tests/misc_test.go Outdated
Expect(err).ToNot(HaveOccurred())
defer resp.Body.Close()
Expect(resp.StatusCode).To(Equal(200))
err = cupaloy.New().SnapshotMulti(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove this snapshot check.

Comment thread e2e_tests/misc_test.go Outdated
defer resp.Body.Close()
Expect(resp.StatusCode).To(Equal(401))
}
err = cupaloy.New().SnapshotMulti(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove this snapshot check.

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.

Implement E2E Test Suite Using Ginkgo

2 participants