Skip to content

add firestore-backed application datastore integration test - #7077

Merged
armistcxy merged 12 commits into
pipe-cd:masterfrom
ayushsarode:add-firestore-test
Sep 25, 2026
Merged

armistcxy merged 12 commits into
pipe-cd:masterfrom
ayushsarode:add-firestore-test

Conversation

@ayushsarode

Copy link
Copy Markdown
Contributor

What this PR does:

Adds integration test coverage for the Firestore-backed application datastore.

The tests cover core application datastore behavior against Firestore, including creating, retrieving, listing, updating, and deleting application records where applicable. This follows the existing datastore integration test pattern used in the repository.

Why we need it:

Application data is a core part of PipeCD’s datastore layer, and Firestore-specific behavior can differ from unit-test assumptions around document structure, queries, updates, and serialization.

Adding integration coverage helps catch regressions earlier and gives maintainers more confidence that the Firestore implementation stays consistent with the expected datastore contract.

Which issue(s) this PR fixes:

Fixes #7076

Does this PR introduce a user-facing change?:

No.

  • How are users affected by this change:
    Users are not directly affected. This is a test-only change that improves confidence in Firestore datastore behavior.

  • Is this breaking change:
    No.

  • How to migrate (if breaking change):
    Not applicable.

Signed-off-by: ayushsarode <ayushsarode777@gmail.com>
@ayushsarode
ayushsarode requested a review from a team as a code owner July 23, 2026 07:56
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi @ayushsarode, welcome to PipeCD and thanks for opening your first pull request!

We’re really happy to have you here

Before your PR gets merged, please check a few important things below.


Helpful resources


DCO Sign-off

All commits must include a Signed-off-by line to comply with the Developer Certificate of Origin (DCO).

In case you forget to sign-off your commit(s), follow these steps:

For the last commit:

git commit --amend --signoff
git push --force-with-lease

For multiple commits:

git rebase --signoff origin/master
git push --force-with-lease

Run checks locally

Before pushing updates, please run:

make check

This runs the same checks as CI and helps catch issues early.


💬 Need help?

If anything is unclear, feel free to ask in this PR or join us on the CNCF Slack in the #pipecd channel.
You can get your Slack invite from: https://communityinviter.com/apps/cloud-native/cncf

Thanks for contributing to PipeCD! ❤️

@ayushsarode

Copy link
Copy Markdown
Contributor Author

@rahulshendre please lmk if this integration test PR adds value

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions Bot added the Stale label Aug 31, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 7 days with no activity. Feel free to reopen if still applicable.

@github-actions github-actions Bot closed this Sep 8, 2026
@rahulshendre rahulshendre reopened this Sep 8, 2026
@rahulshendre rahulshendre removed the Stale label Sep 8, 2026
@rahulshendre

Copy link
Copy Markdown
Contributor

@netlify

netlify Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for pipecd-site ready!

Name Link
🔨 Latest commit 8ccf2be
🔍 Latest deploy log https://app.netlify.com/projects/pipecd-site/deploys/6ab66f2e6f2d410008a448b0
😎 Deploy Preview https://deploy-preview-7077--pipecd-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@armistcxy

armistcxy commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Hi @ayushsarode, sorry for late reply

Please consider adding test for FindApplication like the way MySQL did

func TestFindApplication(t *testing.T) {

Also I found out that the added tests are near identical versions of generic tests from firestore_test.go

Copilot AI left a comment

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.

🟡 Changes recommended

Add listing coverage and verify persisted fields after successful creation and update.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds Firestore-backed integration tests for application datastore behavior.

Changes:

  • Tests retrieval, creation, duplicate handling, and updates.
  • Covers error and success paths against Firestore.
  • Listing coverage and persistence assertions remain unresolved.
File summaries
File Summary
test/integration/datastore/firestore/application_test.go Adds Firestore application datastore integration tests.
Review details

Suppressed comments (1)

test/integration/datastore/firestore/application_test.go:124

  • The successful create case only checks that Create returned nil; it never reads the document back. A Firestore write or serialization bug could therefore pass this test, and the successful case also uses id-new while the entity still has Id: "create-id". Fetch the new document and assert its stored fields (or make the entity ID match the document ID).
	for _, tc := range testcases {
		t.Run(tc.name, func(t *testing.T) {
			err := store.Create(ctx, col, tc.id, fakeApplication)
			assert.Equal(t, tc.wantErr, err)
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/integration/datastore/firestore/application_test.go
Comment on lines +187 to +192
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
err := store.Update(ctx, col, tc.id, tc.updater)
assert.Equal(t, tc.wantErr, err)
})
}
ayushsarode and others added 2 commits September 15, 2026 21:55
Replace redundant Application CRUD tests with Find coverage matching
the MySQL integration test, since generic CRUD is already covered in
firestore_test.go.

Signed-off-by: ayushsarode <ayushsarode777@gmail.com>
@ayushsarode

Copy link
Copy Markdown
Contributor Author

@armistcxy could you please review it now?

@armistcxy

Copy link
Copy Markdown
Contributor

wait, I've asked you to add the FindApplicationTest, why you delete all the old tests for Get, Create, Update application ?

@ayushsarode

Copy link
Copy Markdown
Contributor Author

Hi @armistcxy , my apologies for that!
It was an accidental deletion on my end when adding the FindApplication test. I've just restored the Get, Create, and Update tests and pushed the fix. Thanks for catching this!

@armistcxy

Copy link
Copy Markdown
Contributor

@ayushsarode you forgot to sign off your commit

Signed-off-by: ayushsarode <ayushsarode777@gmail.com>
@ayushsarode

Copy link
Copy Markdown
Contributor Author

@armistcxy could you please check now?

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

The added tests don’t cover delete/disable semantics (or other ApplicationStore contract behaviors) despite the PR description/issue stating they are included, so the scope needs to be expanded or the description corrected.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (1)

Comment on lines +183 to +186
func TestCreateApplication(t *testing.T) {
col := &collection{kind: "Application"}

ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)

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.

@ayushsarode can you add tests for Delete, Enable, Disable

Signed-off-by: ayushsarode <ayushsarode777@gmail.com>
@ayushsarode

Copy link
Copy Markdown
Contributor Author

@armistcxy could you check it now?

@codecov

codecov Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 30.36%. Comparing base (9051e1e) to head (8ccf2be).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7077   +/-   ##
=======================================
  Coverage   30.36%   30.36%           
=======================================
  Files         601      601           
  Lines       52622    52622           
=======================================
  Hits        15980    15980           
  Misses      35123    35123           
  Partials     1519     1519           
Flag Coverage Δ
. 24.34% <ø> (ø)
.-pkg-app-pipedv1-plugin-analysis 29.19% <ø> (ø)
.-pkg-app-pipedv1-plugin-ecs 33.75% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes 59.85% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 60.48% <ø> (ø)
.-pkg-app-pipedv1-plugin-scriptrun 58.22% <ø> (ø)
.-pkg-app-pipedv1-plugin-terraform 39.88% <ø> (ø)
.-pkg-app-pipedv1-plugin-wait 32.22% <ø> (ø)
.-pkg-app-pipedv1-plugin-waitapproval 55.14% <ø> (ø)
.-pkg-plugin-sdk 52.07% <ø> (ø)
.-tool-actions-gh-release 19.94% <ø> (ø)
.-tool-actions-plan-preview 28.04% <ø> (ø)
.-tool-codegen-protoc-gen-auth 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rahulshendre rahulshendre left a comment

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.

@ayushsarode, please sign off your commit.

@mohammedfirdouss, please drop your review as well if you get time 😄

@ayushsarode

Copy link
Copy Markdown
Contributor Author

@rahulshendre signed off!

@armistcxy
armistcxy merged commit 452addb into pipe-cd:master Sep 25, 2026
98 of 99 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for contributing to PipeCD, @ayushsarode! The changes in this pull request will be part of the upcoming release!

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.

Add Firestore integration tests for application datastore

4 participants