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

Add ShouldTimeEqual assertion #506

Merged
merged 1 commit into from
Apr 5, 2022
Merged

Add ShouldTimeEqual assertion #506

merged 1 commit into from
Apr 5, 2022

Conversation

marcaudefroy
Copy link
Collaborator

ShoudlEqual assertion return error when we try to compare time in differents location.

To resolve this issue, we add ShouldEqualTime assertion to check equality between two time.Time.

// ShouldTimeEqual receives exactly 2 time.Time arguments and does a time equality check.
// The arguments have to respect the date format RFC3339, as 2006-01-02T15:04:00+07:00
//
// Example of testsuite file:
//
//  name: test ShouldTimeEqual
//  vars:
//    time_1: 2006-01-02T13:04:00Z
//    time_2: 2006-01-02T15:04:00+02:00
//  testcases:
//  - name: test assertion
//    steps:
//    - type: exec
//      script: "echo {{.time}}"
//      assertions:
//        - result.systemout ShouldTimeEqual "{{.time_1}}" 

@ovh-cds
Copy link
Collaborator

ovh-cds commented Feb 10, 2022

CDS Report build-venom-a#822.0 ✘

  • Build
    • Build ✘

@ovh-cds
Copy link
Collaborator

ovh-cds commented Feb 10, 2022

CDS Report build-venom-a#823.0 ✘

  • Build
    • Build ✘

Signed-off-by: marc audefroy <[email protected]>
@ovh-cds
Copy link
Collaborator

ovh-cds commented Feb 10, 2022

CDS Report build-venom-a#824.0 ✘

  • Build
    • Build ✔
  • Tests
    • Acceptance Tests ✘

@sonarcloud
Copy link

sonarcloud bot commented Feb 10, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

72.7% 72.7% Coverage
0.0% 0.0% Duplication

@fsamin fsamin merged commit c2f39b0 into master Apr 5, 2022
@fsamin fsamin deleted the should_equal_time branch April 5, 2022 14:40
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.

4 participants