TF013 Scan code for references

Declare code sources in the manifest and verify Speky discovers tagged references

Is a test for
Source

Source file: specs/tests/functional.yaml

Loaded from: speky

Initial state

The expected state is the final state of TF012 Use a project manifest

Procedure

Step 1

Add code_sources to the manifest

$ cat speky.yaml
kind: project
name: my-project
files:
  - requirements.yaml
  - tests.yaml
code_sources:
  - src/

Step 2

Create a Python source file with a tagged comment

$ cat src/feature.py
# speky:my-project#RF01
def feature():
    pass

Step 3

Run speky and verify the reference to RF01 is reported

$ speky speky.yaml --check-only
Loading speky.yaml
Loading requirements.yaml
Loading tests.yaml
Scanning src/
Found reference to RF01 in src/feature.py:1 (feature)

Step 4

Verify that a tag with an unknown namespace is silently ignored

$ cat src/other.py
# speky:other-project#RF01
def unrelated():
    pass

Step 5

Run speky again and verify the foreign tag does not appear in the output

$ speky speky.yaml --check-only