Skip to content

Conversation

@Monforton
Copy link
Collaborator

also generate basic metrics for consumption

also generate basic metrics for consumption
@Monforton Monforton force-pushed the feature/github-action branch 2 times, most recently from 5a4e42c to abe72ba Compare December 18, 2024 19:02
@Monforton Monforton force-pushed the feature/github-action branch from abe72ba to 3521da4 Compare December 18, 2024 19:06
@mbristol580 mbristol580 requested review from cbridges1, eolatham and mbristol580 and removed request for eolatham February 7, 2025 19:23
@Monforton Monforton marked this pull request as ready for review February 21, 2025 19:30
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

mrge found 9 issues across 7 files. View them in mrge.io

echo "### Overall Statistics" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Total Tests:** \`$total\`" >> $GITHUB_STEP_SUMMARY
echo "- **Pass Rate:** \`$pass_percentage%\`" > $GITHUB_STEP_SUMMARY
Copy link

Choose a reason for hiding this comment

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

Using > operator instead of >> will overwrite the entire job summary instead of appending to it, losing previously written content.


func main() {
fmt.Print(strings.TrimLeft(banner, "\n"))
time.Sleep(1 * time.Microsecond)
Copy link

Choose a reason for hiding this comment

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

Unexplained sleep added with no clear purpose. The 1 microsecond duration is so small it's functionally insignificant and likely won't have the intended effect.

Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
if err := client.SendReports(fernUrl, projectName, filePattern, tags, verbose); err != nil {
metricsPath := "test/static/fern_test_run_metrics.txt"
Copy link

Choose a reason for hiding this comment

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

Hardcoded file path could cause issues in different environments or when the code is run from different directories

Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
if err := client.SendReports(fernUrl, projectName, filePattern, tags, verbose); err != nil {
metricsPath := "test/static/fern_test_run_metrics.txt"
Copy link

Choose a reason for hiding this comment

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

No directory existence check before writing to the metrics file

Run: func(cmd *cobra.Command, args []string) {
if err := client.SendReports(fernUrl, projectName, filePattern, tags, verbose); err != nil {
metricsPath := "test/static/fern_test_run_metrics.txt"
if err := client.SendReports(fernUrl, projectName, filePattern, tags, verbose, metricsPath); err != nil {
Copy link

Choose a reason for hiding this comment

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

New parameter added without making it configurable via CLI flags

log.Default().Printf("Total tests failed: %d\n", failed)
log.Default().Printf("Total tests skipped: %d\n", skipped)

if file, err := os.Create(metricsFilePath); err != nil {
Copy link

Choose a reason for hiding this comment

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

File handling doesn't properly check WriteString errors or use defer for closing

- name: Run Tests
...
- name: Report tests to fern
uses: guidewire-oss/fern-junit-client@latest
Copy link

Choose a reason for hiding this comment

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

Using 'latest' tag for GitHub Actions can lead to unexpected behavior when breaking changes are introduced

url: 'https://fern.mydomain.com'
file-pattern: 'tests/*.xml'
project-name: 'My Service'
tags: 'cpu,'
Copy link

Choose a reason for hiding this comment

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

Trailing comma in tags list looks like a typo and could be confusing to users

with:
url: 'https://fern.mydomain.com'
file-pattern: 'tests/*.xml'
project-name: 'My Service'
Copy link

Choose a reason for hiding this comment

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

Project identification appears inconsistent between CLI and GitHub Action examples

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.

2 participants