Skip to content

test_upstream.py taking too long #437

Description

@Hritik14

Currently the upstream test is performed by calling updated_advisories with 1 batch size for all the importers. This is inefficient. Given that we want to move to non batch based processing anyway, we'd need to replace this test.

Instead we can have a test that loops over all the data sources and calls a test_upstream() function with the data source.
The test_upstream() would have a basic if-elif (switch like) structure which would run test for the respective upstream. The default case could be to fail the test entirely effectively rejecting the importer without an upstream test.

Something like this:

def test_upstream(data_source):
  if data_source == "DebianDataSource":
    # perform Debian upstream test here
    return
  ..
  ..
  ..
  raise NoUpstreamTestException

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions