fsprojects / FSharp.Configuration

The FSharp.Configuration project contains type providers for the configuration of .NET projects.
http://fsprojects.github.io/FSharp.Configuration/
Other
114 stars 63 forks source link

[YamlConfig] Add TimeStamp tag support #102

Closed allykzam closed 7 years ago

allykzam commented 7 years ago

Adds basic support for the TimeStamp tag in YAML configuration files. Includes a new test to verify that the new type is returned correctly from the sample file, and updates to the Settings2.yaml file to make sure it saves correctly as well.

Added the DateTimeOffset after TimeSpan in the ParseStr function so that it does not accidentally parse TimeSpan values as times instead.

allykzam commented 7 years ago

Anyone know why the Smtp and Pop3 blocks would switch places during the AppVeyor test, but not during the Travis test or my local test? I have not touched anything related to their sort order that I know of.

vasily-kirichenko commented 7 years ago

Please fix the tests.

allykzam commented 7 years ago

@vasily-kirichenko as mentioned above, the only failure is that the Smtp and Pop3 blocks in a test case switched places, and only in one of the three places that the tests ran.

As I understand it, this was initially resolved by setting ComparerForKeySorting to null in the serializer settings, based on xoofx/SharpYaml#2. However, that does not seem to honor a specific order, it just indicates a lack of preference for the resulting order.

I can try to adjust YamlConfig to provide an explicit sort order on all fields, but I assume that would mean many changes unrelated to the point of this pull-request. Is there another way you can see to fix the test?