Skip to content

Unit Test Failures with go 1.15 #1202

@danielhelfand

Description

@danielhelfand

The following issues occur when running tkn unit tests using go 1.15:

# github.com/tektoncd/cli/pkg/formatted
pkg/formatted/color_test.go:42:10: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

    --- FAIL: Test_ClusterTask_Start_v1beta1/Dry_run_with_invalid_--timeout_v1beta1 (0.00s)
        start_test.go:1625: 
            Unexpected output:
              string(
            -   `time: unknown unit "d" in duration "5d"`,
            +   "time: unknown unit d in duration 5d",
              )
            
            
            Expected
            time: unknown unit d in duration 5d
            
            Actual
            time: unknown unit "d" in duration "5d"
FAIL

    --- FAIL: TestPipelineV1beta1Start_ExecuteCommand/Dry_Run_with_invalid_--timeout_specified (0.00s)
        start_test.go:1382: 
            Unexpected output:
              string(
            -   `time: unknown unit "d" in duration "5d"`,
            +   "time: unknown unit d in duration 5d",
              )
            
            
            Expected
            time: unknown unit d in duration 5d
            
            Actual
            time: unknown unit "d" in duration "5d"
FAIL

    --- FAIL: TestTaskStart_ExecuteCommand_v1beta1/Dry_Run_with_invalid_--timeout_specified (0.00s)
        start_test.go:4586: 
            Unexpected output:
              string(
            -   `time: unknown unit "d" in duration "5d"`,
            +   "time: unknown unit d in duration 5d",
              )
            
            
            Expected
            time: unknown unit d in duration 5d
            
            Actual
            time: unknown unit "d" in duration "5d"
FAIL

Main issue appears to be the quotations used in the new error from time.ParseDuration().

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/testingIssues or PRs related to testing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions