Page MenuHomeSoftware Heritage

swh-scanner: integration tests
ClosedPublic

Authored by DanSeraf on Mar 6 2020, 4:40 PM.

Details

Summary

Basic tests for the scanner tool (T2299)

The test_scanner_result is using the flask live_server fixture as a backend, it simulates the response of the Web API endpoint /known/. The flask /known/ endpoint uses a predefined list of persistent identifiers available in swh.scanner.tests.data.

Diff Detail

Repository
rDTSCN Code scanner
Branch
integration-test
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10991
Build 16543: tox-on-jenkinsJenkins
Build 16542: arc lint + arc unit

Event Timeline

I'm restarting the tests

The test will fail because of D2785

You can tell Arcanist to apply both diffs before running the tests. On this page, click "Edit related revisions" > "Edit parent revisions" > add D2785

vlorentz requested changes to this revision.Mar 6 2020, 4:59 PM

Looks good! Just a couple of nitpicks:

swh/scanner/tests/test_scanner.py
16

Use "example.org" or one of its subdomains as domain, it avoids using a domain that belongs to someone.

46
def test_app(app):
    """Ensures the app not in debug mode"""
    assert not app.debug

The second argument of assert is a message to be displayed on error, not a comment.

This revision now requires changes to proceed.Mar 6 2020, 4:59 PM
This revision is now accepted and ready to land.Mar 10 2020, 10:39 AM
This revision was automatically updated to reflect the committed changes.