Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,21 @@ jobs:
with:
target: //test/integration/submitqueue/extension/storage/...

stovepipe-integration-test:
name: Stovepipe Integration Test
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# This job executes untrusted PR code (make build/test/lint). Don't
# leave the GITHUB_TOKEN in the workspace git config while it runs.
persist-credentials: false
- uses: ./.github/actions/setup
- uses: ./.github/actions/run-bazel-test
with:
target: //test/integration/stovepipe/...

conflict-integration-test:
name: Conflict Extension Test
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
Expand Down Expand Up @@ -432,6 +447,7 @@ jobs:
- merger-integration-test
- validator-integration-test
- storage-integration-test
- stovepipe-integration-test
- conflict-integration-test
- consumer-integration-test
- web
Expand Down
14 changes: 9 additions & 5 deletions test/integration/stovepipe/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,17 @@ func (s *StovepipeIntegrationSuite) TestProjectStatusAPI() {
assert.Equal(t, int64(4000), remaining.GetUpdatedAtMs())
assert.Empty(t, remaining.NextPageToken)
assert.False(t, remaining.ProjectResultsComplete)
completion := requestlog.NewRequestEventLog(entity.Request{Queue: queue, ID: id}, entity.RequestEventProjectFactsRecorded, "all", map[string]string{requestlog.MetadataKeyProjectFactCount: "3", requestlog.MetadataKeyBrokenProjectFactCount: "2"})
completion.TimestampMs = 6000
factsRecorded := requestlog.NewRequestEventLog(entity.Request{Queue: queue, ID: id}, entity.RequestEventProjectFactsRecorded, "all", map[string]string{requestlog.MetadataKeyProjectFactCount: "3", requestlog.MetadataKeyBrokenProjectFactCount: "2"})
factsRecorded.TimestampMs = 6000
backend, err := mysqlstorage.NewStorage(s.db, tally.NoopScope)
require.NoError(t, err)
stores, err := backend.For(queue)
require.NoError(t, err)
require.NoError(t, requestlog.NewMaterializer(tally.NoopScope).PersistLog(s.ctx, stores, completion))
materializer := requestlog.NewMaterializer(tally.NoopScope)
require.NoError(t, materializer.PersistLog(s.ctx, stores, factsRecorded))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[flaky-1-d1-reviewer] nit (optional): nothing in this test observes this persist any more. Since #1065, ProjectFactsRecorded sets only ProjectCount and BrokenProjectCount (stovepipe/core/requestlog/request_summary.go:121-122), and GetProjectStatus reads neither (stovepipe/controller/project_status.go:145-181). Every assertion below passes with or without it. TestProjectRequestSummaryCompletesAfterProjectFacts already covers "facts alone do not complete" as a unit test.

The smaller alternative is to retarget the existing log to entity.RequestEventProjectAnalysisCompleted, "build-1", nil metadata, at 6000, with a single persist. The spec asked to keep the facts log so the test mirrors the stage's order (projectanalysis.go:282, then :162), so declining is fine.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[flaky-1-d1-implementer] declined: the facts-recorded write is kept on purpose so the test follows production order (facts recorded, then analysis completed), as the spec asked. Dropping it would shrink the diff but make the test less representative.

analysisCompleted := requestlog.NewRequestEventLog(entity.Request{Queue: queue, ID: id}, entity.RequestEventProjectAnalysisCompleted, "build-1", nil)
analysisCompleted.TimestampMs = 6000
require.NoError(t, materializer.PersistLog(s.ctx, stores, analysisCompleted))
completed, err := s.client.GetProjectStatusByURI(s.ctx, &pb.GetProjectStatusByURIRequest{
Queue: queue, ChangeUri: uri, PageSize: 1,
})
Expand All @@ -412,7 +416,7 @@ func (s *StovepipeIntegrationSuite) TestProjectStatusAPI() {
}
}

func (s *StovepipeIntegrationSuite) TestAbandonedProjectResultsAreComplete() {
func (s *StovepipeIntegrationSuite) TestAbandonedProjectAnalysisCompletesProjectResults() {
for _, recordedProject := range []bool{false, true} {
name := "empty"
if recordedProject {
Expand Down Expand Up @@ -444,7 +448,7 @@ func (s *StovepipeIntegrationSuite) TestAbandonedProjectResultsAreComplete() {
require.NoError(t, err)
assert.False(t, pending.ProjectResultsComplete)

abandonment := requestlog.NewRequestEventLog(entity.Request{Queue: queue, ID: id}, entity.RequestEventRecordAbandoned, "repository", nil)
abandonment := requestlog.NewRequestEventLog(entity.Request{Queue: queue, ID: id}, entity.RequestEventProjectAnalysisAbandoned, "projects", nil)
abandonment.TimestampMs = 4000
materializer := requestlog.NewMaterializer(tally.NoopScope)
require.NoError(t, materializer.PersistLog(s.ctx, stores, abandonment))
Expand Down
Loading