KalibroModuleLongNameValidator methods validate within a different processing and with the same granularity and the same long name is expected to NOT add any errors
Failure/Error: same_name.save
ActiveRecord::RecordNotUnique:
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "processings_pkey"
DETAIL: Key (id)=(1) already exists.
: INSERT INTO "processings" ("created_at", "updated_at", "state", "root_module_result_id", "id") VALUES ($1, $2, $3, $4, $5) RETURNING "id"
Running just rspec --seed 20271 does not produce the error. On the other hand, the first script runs DatabaseCleaner before and after running, so the database should be left clean after the first script.
So we need to investigate deeper wether the first script is leaving the database dirty or is leaving the ids sequence in some special state that produces the test error or even if the unit test itself is touching the database unnecessarily.
While developing https://github.com/mezuro/kalibro_processor/pull/211 I ran into an special seed for our unit tests. By running
ruby performance/tests/aggregation.rb && rspec --seed 20271
from that branch:Running just
rspec --seed 20271
does not produce the error. On the other hand, the first script runsDatabaseCleaner
before and after running, so the database should be left clean after the first script.So we need to investigate deeper wether the first script is leaving the database dirty or is leaving the ids sequence in some special state that produces the test error or even if the unit test itself is touching the database unnecessarily.