gocodebox/lifterlms-rest

Add delta on assertion for date comparison on phpunit test(s)

thomasplevy opened this issue · 10 comments

1) LLMS_REST_Test_Enrollments::test_create_enrollment
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2020-09-24 20:26:47'
+'2020-09-24 20:26:46'
/home/travis/build/gocodebox/lifterlms-rest/tests/unit-tests/server/class-llms-rest-test-enrollments.php:375

This test is failing, intermittently. Adding a delta -- even 10 seconds -- will allow us to ensure the function is still working with an acceptable degree of error here.

Hi, I saw the code and I think I can fix it for you!

@Oaparecido awesome, PRs are always welcome! Any questions let us know

@thomasplevy please attribute this issue to me!

Hey buddy, I'm having some problems to run your project in my machine, can you help me? Here's the screenshot

Screenshot from 2020-09-27 14-54-08
Screenshot from 2020-09-27 14-54-41

@Oaparecido have you tried deleting the /vendor directory and re-installing?

It looks to me like things haven't actually been installed. Can you clean or remove the vendor directory and try installing again.

Also, note that you must install the test suite with composer run tests-install before you can actually run the tests. It looks like your test command is failing because this command has not been run.

https://github.com/gocodebox/lifterlms-rest#tests-and-coding-standards

So, I can't run this here, it installs all the dependencies but when I try to run the composer run tests-install it returns the following problem :
Screenshot from 2020-09-28 14-33-31

Did you run a Docker on this application?

@Oaparecido

svn: command not found

Do you have SVN installed? The test suite installs WP core (and other releated dependencies) via SVN.

Did you run a Docker on this application?

I'd like to move everything over to run tests within a docker container but I haven't found the time to make these switches yet.

All the tests run automatically on PRs via Travis so if you're finding it too tiresome or difficult to install tests locally you can submit a PR and let Travis do it all for you, by the way.

@Oaparecido

svn: comando não encontrado

Você tem o SVN instalado? O conjunto de testes instala o núcleo WP (e outras dependências releatadas) via SVN.

I just realized that, I let it go unnoticed, sorry

No problem!