Skip to content

🧪 add integration tests for idstack-learnings-delete#31

Open
savvides wants to merge 1 commit into
mainfrom
test-idstack-learnings-delete-2258383791522170302
Open

🧪 add integration tests for idstack-learnings-delete#31
savvides wants to merge 1 commit into
mainfrom
test-idstack-learnings-delete-2258383791522170302

Conversation

@savvides
Copy link
Copy Markdown
Owner

🎯 What: Added missing integration test for idstack-learnings-delete.
📊 Coverage: Tests successful deletion (happy path), handling missing arguments, missing keys, and missing learning file.
Result: Improved test coverage for bin/idstack-learnings-delete.


PR created automatically by Jules for task 2258383791522170302 started by @savvides

Added integration tests for `idstack-learnings-delete` script in
`test/integration-test.sh`. It tests successful deletion,
handling missing files, non-existent keys, and missing arguments.

Co-authored-by: savvides <1580637+savvides@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces integration tests for the idstack-learnings-delete command, covering successful deletion by key and error handling for missing keys, arguments, or files. The reviewer suggested using a Python-based JSON parser instead of grep to verify the contents of the .idstack/learnings.jsonl file more robustly, preventing potential false positives.

Comment thread test/integration-test.sh
$IDSTACK_DIR/bin/idstack-learnings-log '{"skill":"test","type":"operational","key":"to-keep","insight":"keep me","confidence":9}'

check "deletes specific learning by key" \
"$IDSTACK_DIR/bin/idstack-learnings-delete to-delete && ! grep -q 'to-delete' .idstack/learnings.jsonl && grep -q 'to-keep' .idstack/learnings.jsonl"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using grep to verify the contents of a JSONL file is fragile and can lead to false positives or negatives if the search string (e.g., to-delete) appears in other fields like insight or skill. Since the script already uses python3 for JSON validation in other tests (e.g., lines 37, 57, 77), it is more robust to parse the JSON and verify the specific keys.

Suggested change
"$IDSTACK_DIR/bin/idstack-learnings-delete to-delete && ! grep -q 'to-delete' .idstack/learnings.jsonl && grep -q 'to-keep' .idstack/learnings.jsonl"
"$IDSTACK_DIR/bin/idstack-learnings-delete to-delete && python3 -c \"import json; keys = [json.loads(l)['key'] for l in open('.idstack/learnings.jsonl')]; assert 'to-delete' not in keys and 'to-keep' in keys\""

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.

1 participant