Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ updates:
directory: /
schedule:
interval: daily
cooldown:
default-days: 7
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ on:
branches:
- master
pull_request:
schedule:
- cron: '0 12 * * *'

permissions: {}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/setup-python@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ">= 3.9"
- name: lint
Expand All @@ -29,10 +31,11 @@ jobs:
- "3.10"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- uses: actions/setup-python@v4
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python }}
- name: deps
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pip-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ on:
schedule:
- cron: "0 12 * * *"

permissions: {}

jobs:
pip-audit:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3.5.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ">= 3.9"

Expand All @@ -30,7 +34,7 @@ jobs:


- name: Run pip-audit
uses: pypa/gh-action-pip-audit@v1.0.8
uses: pypa/gh-action-pip-audit@1220774d901786e6f652ae159f7b6bc8fea6d266 # v1.1.0
with:
virtual-environment: /tmp/pip-audit-env

31 changes: 0 additions & 31 deletions .github/workflows/pythonpublish.yml

This file was deleted.

5 changes: 3 additions & 2 deletions protofuzz/tests/test_pbimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@ def test_generate_and_import(self):
Test generation and loading of protobuf artifacts
"""
name = f"Msg{secrets.token_hex(16)}"
filename = os.path.join(self.tempdir, f"{name}.proto")
contents = "message {} {{ required int32 var = 1; }}\n".format(name)

with open(self.valid_filename, "w") as f:
with open(filename, "w") as f:
f.write(contents)

module = pbimport.from_file(self.valid_filename)
module = pbimport.from_file(filename)
self.assertTrue(hasattr(module, name))

def test_failing_generate_and_import(self):
Expand Down
16 changes: 4 additions & 12 deletions protofuzz/tests/test_protofuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ def test_enum(self):
enum Colors {{ RED = {}; GREEN = {}; BLUE = {}; }}
required Colors color = 1;
}}
""".format(
*enum_values
)
""".format(*enum_values)

messages = protofuzz.from_description_string(definition)

Expand All @@ -125,9 +123,7 @@ def test_floating_point(self):
message {} {{
required double dbl = 1;
required float fl = 2;
}}""".format(
name
)
}}""".format(name)
messages = protofuzz.from_description_string(definition)
for msg in messages[name].linear():
self.assertIsInstance(msg.dbl, float)
Expand All @@ -138,9 +134,7 @@ def _single_field_helper(self, field_type, field_name):
definition = """
message {} {{
required {} {} = 1;
}}""".format(
name, field_type, field_name
)
}}""".format(name, field_type, field_name)
permuter = protofuzz.from_description_string(definition)[name]
return permuter.linear(limit=10)

Expand All @@ -163,9 +157,7 @@ def test_repeated_msg(self):
definition = """
message Inner {{ required int32 val = 1; }}
message {} {{ repeated Inner val = 1; }}
""".format(
name
)
""".format(name)

messages = protofuzz.from_description_string(definition)

Expand Down
Loading