Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System time separator is used when Octo DeployAt argument is converted to string #1314

Closed
bjorkstromm opened this issue Oct 25, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@bjorkstromm
Copy link
Member

What You Are Seeing?

System time separator '.' is used instead of ':' what is expected in the --deployat argument for Octo CreateRelease and Octo DeployRelease

What is Expected?

That the time separator ':' should always be used regardless of system settings.

What version of Cake are you using?

0.17.0-*

Are you running on a 32 or 64 bit system?

64-bit

What environment are you running on? Windows? Linux? Mac?

Windows

Are you running on a CI Server? If so, which one?

Nope

How Did You Get This To Happen? (Steps to Reproduce)

Switch to Finnish regional settings (In Windows 10, default Finnish regional settings will set time separator as '.') or switch Time Separator to '.' and run \build.ps1 and watch unit tests fail.

Output Log

Cake.Common.Tests.Unit.Tools.OctopusDeploy.OctoDeployReleaseTests+DeploymentArgumentBuilder.Should_Add_DeployAt_To_Arguments_If_Specified [FAIL]
      Assert.Equal() Failure
                                       � (pos 151)
      Expected: ···loyat="2010-06-15 00:01"
      Actual:   ···loyat="2010-06-15 00.01"
                                       � (pos 151)
      Stack Trace:
        src\Cake.Common.Tests\Unit\Tools\OctopusDeploy\OctoDeployReleaseTests.cs(408,0): at Cake.Common.Tests.Unit.Tools.OctopusDeploy.OctoDeployReleaseTests.DeploymentArgumentBuilder.Should_Add_DeployAt_To_Arguments_If_Specified()
@bjorkstromm
Copy link
Member Author

Fix by switching:

Builder.AppendSwitchQuoted("--deployat", "=", _settings.DeployAt.Value.ToString("yyyy-MM-dd HH:mm"));

to

Builder.AppendSwitchQuoted("--deployat", "=", _settings.DeployAt.Value.ToString("yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture));

@gep13
Copy link
Member

gep13 commented Oct 25, 2016

@mholo65 this sounds like a very sensible change to me. Are you in a position to create a PR for this? If not, I can make the change.

@gep13 gep13 added the Bug label Oct 25, 2016
@gep13 gep13 added this to the v0.17.0 milestone Oct 25, 2016
@bjorkstromm
Copy link
Member Author

I'm doing it now!

bjorkstromm added a commit to bjorkstromm/cake that referenced this issue Oct 25, 2016
gep13 added a commit that referenced this issue Oct 25, 2016
(GH-1314) Adds CultureInfo.InvariantCulture when converting DateTime to string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants