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

FIX TEST Multiple files cross-contamination extraction #50

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

RomanMeszarosToptal
Copy link
Contributor

Description

The reason for the bug was:

  1. The extractors are loaded into a static array (see fileExtractor.ts lines 7-16)
  2. These are only once initialized and then are loaded when they are appropriate for a file.
  3. The extractors contain their own data - .table.rows. This doesn't get cleared, therefore if multiple files for the same extractor type are used, they all feed into the same array and the data is shared.

Current suggested solution:

  1. Zip test files for the same service type are run sequentially, so that one file uses the extractor data, after it is finished the data gets cleared and another file gets extracted.
  2. I created a static method dumpExtractorData in FileExtractor. This empties all the extractors' .table.rows.
    At the moment this might be enough unless we want to have some sort of data separation in this sense on the client side. Do we expect users to provide multiple zip files for the same extractor type? And if we do, do we want to keep the data in separate sqlite databases?

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.

1 participant