Skip to content

Add acceptance coverage for BOM notebook deletion badness - #7247

Open
janniklasrose wants to merge 1 commit into
mainfrom
janniklasrose/test-sync-bom-delete
Open

janniklasrose wants to merge 1 commit into
mainfrom
janniklasrose/test-sync-bom-delete

Conversation

@janniklasrose

Copy link
Copy Markdown
Member

Changes

Extend the sync replacement acceptance test through deletion and document the orphaned BOM notebook with Badness in test.toml.

Why

After #7218, a BOM-prefixed bom.sql uploads as notebook bom, while sync tracks bom.sql. Removing the local file makes sync report a successful deletion but leaves the remote notebook behind. This test captures the current bug, with plain.sql as a control that is deleted successfully.

Tests

  • Targeted local acceptance test passes in both DMS modes, using a temporary modfile replacing golang.org/x/net v0.62.0 with cached v0.61.0. Repository dependencies are unchanged.
  • Formatting, shell syntax, and diff checks pass.
  • Full checks, lint, and tests could not pass locally: the dependency proxy denies v0.62.0, and full tests also lack Python 3.10/3.13.
  • Cloud execution was not run; the test retains Cloud = true.

This PR was written by Codex.

@github-actions github-actions Bot added the DABs DABs related issues label Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Commit: 5197a234a | Workflow run

Regression test report

Selected 1 changed tests (limit=20, 0 not selected)

2 tests: regression=0 unreleased=2 coverage=0 failing=0

test branch main (8afc86f) latest (v1.22.1)
TestAccept/bundle/sync/replace-node-type/DMS= ✅ ✅ ❌
TestAccept/bundle/sync/replace-node-type/DMS=true ✅ ✅ ❌
TestAccept/bundle/sync/replace-node-type/DMS=: branch ✅ | main (8afc86f) ✅ | latest (v1.22.1) ❌

latest (v1.22.1):

acceptance_test.go:1341: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1341
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1082
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:659
        	Error:      	Not equal: 
        	            	expected: "\n=== A file holds the name of notebook bom.sql, a notebook holds the name of file plain.sql\n\n>>> [CLI] workspace import /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/bom.sql --file bom.sql --format RAW\n\n>>> [CLI] workspace import /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/plain --file plain.sql --format SOURCE --language SQL\n\n>>> list\nFILE bom.sql\nNOTEBOOK plain\n\n=== Sync replaces both\n\n>>> [CLI] bundle sync --output text\nAction: PUT: bom.sql, plain.sql\nInitial Sync Complete\nUploaded bom.sql\nUploaded plain.sql\n\n>>> list\nNOTEBOOK bom\nFILE plain.sql\n\n=== Remove both local files and sync again\n\n>>> [CLI] bundle sync --output text\nAction: DELETE: bom.sql, plain.sql\nDeleted bom.sql\nDeleted plain.sql\nInitial Sync Complete\n\n=== BUG: bom remains after sync reports deleting bom.sql\n\n>>> list\nNOTEBOOK bom\n"
        	            	actual  : "\n=== A file holds the name of notebook bom.sql, a notebook holds the name of file plain.sql\n\n>>> [CLI] workspace import /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/bom.sql --file bom.sql --format RAW\n\n>>> [CLI] workspace import /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/plain --file plain.sql --format SOURCE --language SQL\n\n>>> list\nFILE bom.sql\nNOTEBOOK plain\n\n=== Sync replaces both\n\n>>> [CLI] bundle sync --output text\nAction: PUT: bom.sql, plain.sql\nError: file already exists: /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/plain.sql\n\nExit code: 1\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -15,22 +15,5 @@
        	            	 Action: PUT: bom.sql, plain.sql
        	            	-Initial Sync Complete
        	            	-Uploaded bom.sql
        	            	-Uploaded plain.sql
        	            	+Error: file already exists: /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/plain.sql
        	            	 
        	            	->>> list
        	            	-NOTEBOOK bom
        	            	-FILE plain.sql
        	            	+Exit code: 1
        	            	 
        	            	-=== Remove both local files and sync again
        	            	-
        	            	->>> [CLI] bundle sync --output text
        	            	-Action: DELETE: bom.sql, plain.sql
        	            	-Deleted bom.sql
        	            	-Deleted plain.sql
        	            	-Initial Sync Complete
        	            	-
        	            	-=== BUG: bom remains after sync reports deleting bom.sql
        	            	-
        	            	->>> list
        	            	-NOTEBOOK bom
        	            	-
        	Test:       	TestAccept/bundle/sync/replace-node-type/DMS=
        	Messages:   	bundle/sync/replace-node-type/output.txt vs /tmp/TestAcceptbundlesyncreplace-node-typeDMS=2873570995/002/output.txt
TestAccept/bundle/sync/replace-node-type/DMS=true: branch ✅ | main (8afc86f) ✅ | latest (v1.22.1) ❌

latest (v1.22.1):

acceptance_test.go:1341: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1341
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1082
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:659
        	Error:      	Not equal: 
        	            	expected: "\n=== A file holds the name of notebook bom.sql, a notebook holds the name of file plain.sql\n\n>>> [CLI] workspace import /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/bom.sql --file bom.sql --format RAW\n\n>>> [CLI] workspace import /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/plain --file plain.sql --format SOURCE --language SQL\n\n>>> list\nFILE bom.sql\nNOTEBOOK plain\n\n=== Sync replaces both\n\n>>> [CLI] bundle sync --output text\nAction: PUT: bom.sql, plain.sql\nInitial Sync Complete\nUploaded bom.sql\nUploaded plain.sql\n\n>>> list\nNOTEBOOK bom\nFILE plain.sql\n\n=== Remove both local files and sync again\n\n>>> [CLI] bundle sync --output text\nAction: DELETE: bom.sql, plain.sql\nDeleted bom.sql\nDeleted plain.sql\nInitial Sync Complete\n\n=== BUG: bom remains after sync reports deleting bom.sql\n\n>>> list\nNOTEBOOK bom\n"
        	            	actual  : "\n=== A file holds the name of notebook bom.sql, a notebook holds the name of file plain.sql\n\n>>> [CLI] workspace import /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/bom.sql --file bom.sql --format RAW\n\n>>> [CLI] workspace import /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/plain --file plain.sql --format SOURCE --language SQL\n\n>>> list\nFILE bom.sql\nNOTEBOOK plain\n\n=== Sync replaces both\n\n>>> [CLI] bundle sync --output text\nAction: PUT: bom.sql, plain.sql\nError: file already exists: /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/plain.sql\n\nExit code: 1\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -15,22 +15,5 @@
        	            	 Action: PUT: bom.sql, plain.sql
        	            	-Initial Sync Complete
        	            	-Uploaded bom.sql
        	            	-Uploaded plain.sql
        	            	+Error: file already exists: /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/plain.sql
        	            	 
        	            	->>> list
        	            	-NOTEBOOK bom
        	            	-FILE plain.sql
        	            	+Exit code: 1
        	            	 
        	            	-=== Remove both local files and sync again
        	            	-
        	            	->>> [CLI] bundle sync --output text
        	            	-Action: DELETE: bom.sql, plain.sql
        	            	-Deleted bom.sql
        	            	-Deleted plain.sql
        	            	-Initial Sync Complete
        	            	-
        	            	-=== BUG: bom remains after sync reports deleting bom.sql
        	            	-
        	            	->>> list
        	            	-NOTEBOOK bom
        	            	-
        	Test:       	TestAccept/bundle/sync/replace-node-type/DMS=true
        	Messages:   	bundle/sync/replace-node-type/output.txt vs /tmp/TestAcceptbundlesyncreplace-node-typeDMS=true56829631/002/output.txt
FAIL

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 5197a23

Run: 40861069132

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 284 15 5:37
✅​ aws-windows-latest-4core-16gb 286 13 3:39
✅​ azure linux-2core-8gb 283 15 5:23
✅​ azure-windows-latest-4core-16gb 285 13 5:30
✅​ gcp linux-2core-8gb 284 15 5:27
✅​ gcp-windows-latest-4core-16gb 286 13 5:06
Top 6 slowest tests (at least 2 minutes):
duration env testname
5:05 azure-windows-latest-4core-16gb TestAccept
4:40 gcp-windows-latest-4core-16gb TestAccept
3:54 aws linux-2core-8gb TestAccept
3:50 azure linux-2core-8gb TestAccept
3:45 gcp linux-2core-8gb TestAccept
3:10 aws-windows-latest-4core-16gb TestAccept

@janniklasrose
janniklasrose marked this pull request as ready for review October 29, 2026 11:42
@janniklasrose
janniklasrose requested review from a team as code owners October 29, 2026 11:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants