Skip to content

Comments

chore: improve code mark tests and remove worklog stubs#28

Merged
Hinne1 merged 1 commit intomainfrom
claude/improve-tests-remove-tempo
Feb 17, 2026
Merged

chore: improve code mark tests and remove worklog stubs#28
Hinne1 merged 1 commit intomainfrom
claude/improve-tests-remove-tempo

Conversation

@Hinne1
Copy link
Contributor

@Hinne1 Hinne1 commented Feb 17, 2026

Summary

  • Expanded italic, strikethrough, and bold+codeBlock tests with full node-by-node assertions (addresses review feedback from fix: treat code mark as exclusive in ADF inline formatting #27)
  • Removed unimplemented worklog/tempo command stubs (5 files) and all Tempo references from README, AGENTS.md, and root command

Test plan

  • All existing tests pass
  • golangci-lint run reports 0 issues
  • go build succeeds without the worklog package

- Expand italic and strikethrough tests to assert all inline nodes
  (not just code nodes), matching the thoroughness of the bold test
- Expand the bold+codeBlock combo test with full node assertions
- Remove unimplemented worklog/tempo command stubs and references
  from root command, README, and AGENTS.md
@gemini-code-assist
Copy link

Summary of Changes

Hello @Hinne1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the atl CLI tool by enhancing the robustness of its markdown rendering tests and performing a significant cleanup of unused and unimplemented Tempo-related features. The changes improve code quality and maintainability by removing dead code and strengthening test assertions for core functionalities.

Highlights

  • Improved Markdown Rendering Tests: Expanded test coverage for italic, strikethrough, and bold+codeBlock markdown conversions to include detailed node-by-node assertions, addressing previous review feedback.
  • Removed Unimplemented Tempo Features: Eliminated all unimplemented worklog/Tempo command stubs and associated references from documentation and the main CLI command structure, streamlining the codebase.
Changelog
  • AGENTS.md
    • Removed all mentions of 'Tempo' from the overview and limitations sections.
    • Deleted the 'worklog/' entry from the internal directory structure description.
  • README.md
    • Updated the project description to remove 'Tempo' as a supported integration.
  • internal/api/markdown_code_mark_test.go
    • Refactored TestMarkdownToADF_CodeInsideItalic to include detailed node-by-node assertions for inline elements and their marks.
    • Refactored TestMarkdownToADF_CodeInsideStrikethrough to include detailed node-by-node assertions for inline elements and their marks.
    • Refactored TestMarkdownToADF_BoldWithCodeAndCodeBlock to include detailed node-by-node assertions for inline elements and their marks.
  • internal/cmd/root.go
    • Removed the import for the worklogCmd package.
    • Updated the Short and Long descriptions of the root command to exclude 'Tempo'.
    • Removed the worklogCmd from the list of added subcommands.
  • internal/cmd/worklog/add.go
    • Removed the entire file, which contained the unimplemented worklog add command stub.
  • internal/cmd/worklog/delete.go
    • Removed the entire file, which contained the unimplemented worklog delete command stub.
  • internal/cmd/worklog/edit.go
    • Removed the entire file, which contained the unimplemented worklog edit command stub.
  • internal/cmd/worklog/list.go
    • Removed the entire file, which contained the unimplemented worklog list command stub.
  • internal/cmd/worklog/worklog.go
    • Removed the entire file, which defined the worklog command group and its subcommands.
Activity
  • Hinne1 expanded markdown rendering tests with full node-by-node assertions, addressing feedback from fix: treat code mark as exclusive in ADF inline formatting #27.
  • Hinne1 removed unimplemented worklog/Tempo command stubs and all related references.
  • All existing tests passed after changes.
  • golangci-lint run reported 0 issues.
  • go build succeeded without the worklog package.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/enthus-appdev/atl-cli/internal/api 36.59% (ø)
github.com/enthus-appdev/atl-cli/internal/cmd 0.00% (ø)
github.com/enthus-appdev/atl-cli/internal/cmd/worklog 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/enthus-appdev/atl-cli/internal/cmd/root.go 0.00% (ø) 30 (-1) 0 30 (-1)
github.com/enthus-appdev/atl-cli/internal/cmd/worklog/add.go 0.00% (ø) 0 (-14) 0 0 (-14)
github.com/enthus-appdev/atl-cli/internal/cmd/worklog/delete.go 0.00% (ø) 0 (-9) 0 0 (-9)
github.com/enthus-appdev/atl-cli/internal/cmd/worklog/edit.go 0.00% (ø) 0 (-11) 0 0 (-11)
github.com/enthus-appdev/atl-cli/internal/cmd/worklog/list.go 0.00% (ø) 0 (-12) 0 0 (-12)
github.com/enthus-appdev/atl-cli/internal/cmd/worklog/worklog.go 0.00% (ø) 0 (-6) 0 0 (-6)

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/enthus-appdev/atl-cli/internal/api/markdown_code_mark_test.go

@Hinne1 Hinne1 merged commit 1f7301c into main Feb 17, 2026
11 checks passed
@Hinne1 Hinne1 deleted the claude/improve-tests-remove-tempo branch February 17, 2026 11:55
Copy link

@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 significantly improves the markdown conversion tests by adding detailed node-by-node assertions, and cleans up the codebase by removing unimplemented worklog command stubs. The documentation in README.md and AGENTS.md has been updated accordingly to reflect the removal of Tempo-related functionality. The changes are well-executed. I've left one suggestion to refactor the new test code to reduce duplication and improve maintainability by using a table-driven test structure.

Comment on lines 50 to 132
func TestMarkdownToADF_CodeInsideItalic(t *testing.T) {
adf := MarkdownToADF("*italic `code` here*")

if len(adf.Content) != 1 {
t.Fatalf("expected 1 block, got %d", len(adf.Content))
}

para := adf.Content[0]
for _, c := range para.Content {
if hasCodeMark(c) {
if len(c.Marks) != 1 {
t.Errorf("code node should have only code mark, got %v", c.Marks)
}
}
if para.Type != "paragraph" {
t.Fatalf("expected paragraph, got %s", para.Type)
}

if len(para.Content) != 3 {
b, _ := json.MarshalIndent(adf, "", " ")
t.Fatalf("expected 3 inline nodes, got %d:\n%s", len(para.Content), b)
}

// "italic " should have em mark
if para.Content[0].Text != "italic " {
t.Errorf("expected 'italic ', got %q", para.Content[0].Text)
}
if len(para.Content[0].Marks) != 1 || para.Content[0].Marks[0].Type != "em" {
t.Errorf("expected [em] marks, got %v", para.Content[0].Marks)
}

// "code" should have ONLY code mark
if para.Content[1].Text != "code" {
t.Errorf("expected 'code', got %q", para.Content[1].Text)
}
if len(para.Content[1].Marks) != 1 || para.Content[1].Marks[0].Type != "code" {
t.Errorf("expected [code] marks only, got %v", para.Content[1].Marks)
}

// " here" should have em mark
if para.Content[2].Text != " here" {
t.Errorf("expected ' here', got %q", para.Content[2].Text)
}
if len(para.Content[2].Marks) != 1 || para.Content[2].Marks[0].Type != "em" {
t.Errorf("expected [em] marks, got %v", para.Content[2].Marks)
}
}

func TestMarkdownToADF_CodeInsideStrikethrough(t *testing.T) {
adf := MarkdownToADF("~~deleted `code` here~~")

if len(adf.Content) != 1 {
t.Fatalf("expected 1 block, got %d", len(adf.Content))
}

para := adf.Content[0]
for _, c := range para.Content {
if hasCodeMark(c) {
if len(c.Marks) != 1 {
t.Errorf("code node should have only code mark, got %v", c.Marks)
}
}
if para.Type != "paragraph" {
t.Fatalf("expected paragraph, got %s", para.Type)
}

if len(para.Content) != 3 {
b, _ := json.MarshalIndent(adf, "", " ")
t.Fatalf("expected 3 inline nodes, got %d:\n%s", len(para.Content), b)
}

// "deleted " should have strike mark
if para.Content[0].Text != "deleted " {
t.Errorf("expected 'deleted ', got %q", para.Content[0].Text)
}
if len(para.Content[0].Marks) != 1 || para.Content[0].Marks[0].Type != "strike" {
t.Errorf("expected [strike] marks, got %v", para.Content[0].Marks)
}

// "code" should have ONLY code mark
if para.Content[1].Text != "code" {
t.Errorf("expected 'code', got %q", para.Content[1].Text)
}
if len(para.Content[1].Marks) != 1 || para.Content[1].Marks[0].Type != "code" {
t.Errorf("expected [code] marks only, got %v", para.Content[1].Marks)
}

// " here" should have strike mark
if para.Content[2].Text != " here" {
t.Errorf("expected ' here', got %q", para.Content[2].Text)
}
if len(para.Content[2].Marks) != 1 || para.Content[2].Marks[0].Type != "strike" {
t.Errorf("expected [strike] marks, got %v", para.Content[2].Marks)
}
}

Choose a reason for hiding this comment

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

medium

Great job on making these tests more thorough! It's a solid improvement.

I noticed that there's a lot of repetitive boilerplate code across TestMarkdownToADF_CodeInsideItalic, TestMarkdownToADF_CodeInsideStrikethrough, and the existing TestMarkdownToADF_CodeInsideBold. The new assertions in TestMarkdownToADF_BoldWithCodeAndCodeBlock also follow this pattern.

To improve maintainability and make it easier to add new test cases, I suggest refactoring these into a single table-driven test. This would centralize the test logic and make the different cases clear and concise.

Here's an example of how you could structure it:

func TestMarkdownToADF_CodeInsideFormatting(t *testing.T) {
	cases := []struct {
		name          string
		markdown      string
		expectedNodes []struct {
			text  string
			marks []string
		}
	}{
		{
			name:     "code inside bold",
			markdown: "**Bold `code` here**",
			expectedNodes: []struct {
				text  string
				marks []string
			}{
				{"Bold ", []string{"strong"}},
				{"code", []string{"code"}},
				{" here", []string{"strong"}},
			},
		},
		{
			name:     "code inside italic",
			markdown: "*italic `code` here*",
			expectedNodes: []struct {
				text  string
				marks []string
			}{
				{"italic ", []string{"em"}},
				{"code", []string{"code"}},
				{" here", []string{"em"}},
			},
		},
		{
			name:     "code inside strikethrough",
			markdown: "~~deleted `code` here~~",
			expectedNodes: []struct {
				text  string
				marks []string
			}{
				{"deleted ", []string{"strike"}},
				{"code", []string{"code"}},
				{" here", []string{"strike"}},
			},
		},
		// You could also move the case from TestMarkdownToADF_BoldWithCodeAndCodeBlock here
	}

	for _, tc := range cases {
		t.Run(tc.name, func(t *testing.T) {
			adf := MarkdownToADF(tc.markdown)

			if len(adf.Content) != 1 {
				t.Fatalf("expected 1 block, got %d", len(adf.Content))
			}

			para := adf.Content[0]
			if para.Type != "paragraph" {
				t.Fatalf("expected paragraph, got %s", para.Type)
			}

			if len(para.Content) != len(tc.expectedNodes) {
				b, _ := json.MarshalIndent(adf, "", "  ")
				t.Fatalf("expected %d inline nodes, got %d:\n%s", len(tc.expectedNodes), len(para.Content), b)
			}

			for i, expected := range tc.expectedNodes {
				actual := para.Content[i]
				if actual.Text != expected.text {
					t.Errorf("node %d: expected text %q, got %q", i, expected.text, actual.Text)
				}

				if len(actual.Marks) != len(expected.marks) {
					t.Errorf("node %d: expected %d marks, got %d (%v)", i, len(expected.marks), len(actual.Marks), actual.Marks)
					continue
				}

				// A simple check for mark types. For more robustness, you could
				// compare the slices of mark types irrespective of order.
				for j, markType := range expected.marks {
					if actual.Marks[j].Type != markType {
						t.Errorf("node %d, mark %d: expected mark type %q, got %q", i, j, markType, actual.Marks[j].Type)
					}
				}
			}
		})
	}
}

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