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

Date-based e2e tests fail in Asia/Krasnoyarsk timezone #612

Open
sjbarag opened this issue Jan 21, 2021 · 0 comments
Open

Date-based e2e tests fail in Asia/Krasnoyarsk timezone #612

sjbarag opened this issue Jan 21, 2021 · 0 comments

Comments

@sjbarag
Copy link
Owner

sjbarag commented Jan 21, 2021

@sjbarag I've fixed tests and refactored code based on suggestions you've provided, I hope that everything is okay now.

FYI, I'm getting some weird issues when running tests locally:

Summary of all failing tests
 FAIL  test/brsTypes/components/RoDateTime.test.js
   RoDateTime  methods  getLastDayOfMonth  returns the date/time value's last day of the month

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Int32 {
        "kind": 4,
    -   "value": 31,
    +   "value": 30,
      }

      210 |                 let result = getLastDayOfMonth.call(interpreter);
      211 |                 expect(getLastDayOfMonth).toBeTruthy();
    > 212 |                 expect(result).toEqual(new Int32(31));
          |                                ^
      213 |             });
      214 |         });
      215 |

      at Object.toEqual (test/brsTypes/components/RoDateTime.test.js:212:32)
      at processTicksAndRejections (node:internal/process/task_queues:93:5)

 FAIL  test/e2e/BrsComponents.test.js (5.228 s)
  ● end to end brightscript functions › components/roDateTime.brs

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

    @@ -20,11 +20,11 @@
        "Minutes: ",
        "14",
        "Seconds: ",
        "15",
        "Last Day of Month: ",
    -   "30",
    +   "29",
        "Milliseconds: ",
        "160",
        "ISO String UTC: ",
        "2010-11-12T13:14:15Z",
      ]

      81 |         await execute([resourceFile("components", "roDateTime.brs")], outputStreams);
      82 |
    > 83 |         expect(allArgs(outputStreams.stdout.write).filter((arg) => arg !== "\n")).toEqual([
         |                                                                                   ^
      84 |             "Full Date: ",
      85 |             "Friday November 12, 2010",
      86 |             "No Week Day: ",

      at Object.toEqual (test/e2e/BrsComponents.test.js:83:83)

These two tests are failing when I run the yarn test locally, but seems to be passing in CI 🤔

Those are both date/time-based issues! Github reports your location as Serbia, so I wouldn't be surprised if our tests are a little flaky — most contributors are in UTC-7 / UTC-4, and the GitHub Actions runners probably use UTC as their timezone.

In fact, I'm able to reproduce that failure by running tests with TZ=Asia/Krasnoyarsk yarn test! You may want to run those tests locally with TZ=UTC yarn test, but I'll file an issue to figure out why those are failing with TZ=Asia/Krasnoyarsk. Sorry about that!

Originally posted by @sjbarag in #598 (comment)

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

No branches or pull requests

1 participant