yetibot / core

:expressionless: Core yetibot utilities, extracted for shared use among Yetibot and its various plugins
https://yetibot.com
Eclipse Public License 1.0
27 stars 17 forks source link

re-org test code so NSs are being tested in the related test file #169

Closed gkspranger closed 3 years ago

gkspranger commented 3 years ago

event tho local tests are working AOK, i expect initial GH test action to fail due to "race condition" concerning the loading of commands .. i believe this is because midje is either running tests in parallel and/or midje facts are ran in isolation << a little odd tho lein test runs locally without fail

will most likely require mod to each test file to include core/loader/load-commands .. will fix as needed

codecov[bot] commented 3 years ago

Codecov Report

Merging #169 (0c33dad) into master (e35cc77) will increase coverage by 2.51%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #169      +/-   ##
==========================================
+ Coverage   47.03%   49.54%   +2.51%     
==========================================
  Files          94       94              
  Lines        4142     4142              
  Branches      195      197       +2     
==========================================
+ Hits         1948     2052     +104     
+ Misses       1999     1893     -106     
- Partials      195      197       +2     
Impacted Files Coverage Δ
src/yetibot/core/repl.clj 18.18% <0.00%> (-36.37%) :arrow_down:
src/yetibot/core/commands/observe.clj 15.70% <0.00%> (+1.65%) :arrow_up:
src/yetibot/core/commands/render.clj 100.00% <0.00%> (+3.22%) :arrow_up:
src/yetibot/core/commands/category.clj 33.33% <0.00%> (+4.44%) :arrow_up:
src/yetibot/core/commands/collections.clj 74.92% <0.00%> (+34.74%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e35cc77...0c33dad. Read the comment docs.

gkspranger commented 3 years ago

the issue around the "race condition" for core/handler was affecting a previous attempt to add new tests for a completely unrelated NS .. even tho there were no mods to core/handler -- it was what was throwing an odd PG errors ::

org.postgresql.util.PSQLException: ERROR: relation "yetibot_channel" does not exist
  Position: 15
  org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2497)
  org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2233)
  org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:310)

this happened previously when i was adding tests to a diff NS -- and the "fix" was simply to add core/loader/load-commands to the tests that were failing .. i am calling it a "race condition", as in "expected NSs were expected to be already loaded but were not` ..

i am hoping these mods will help with future, unrelated tests we may want to add for other NSs << so we don't get the same error

devth commented 3 years ago

@gkspranger thanks + nice work untangling the race condition!!