Flag `--bug-report-dir` does not ensure a unique destination for bug reports

Open
#4,232 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
cli, testing

Research direction

Start by tracing the --bug-report-dir entry point and the bug_report fixture, especially add_file_contents and the test-id-to-filename handling shown in the examples. Reproduce the reported cases and inspect the existing tests around bug-report generation. Done means separate reports do not overwrite one another and generated names no longer retain the closing ] character.

Written by the indexing model from the issue text.

Description

bug pyk

Consider

from pathlib import Path


class Test1:
    def test(self, bug_report):
        bug_report.add_file_contents('test1', Path('test1'))

class Test2:
    def test(self, bug_report):
        bug_report.add_file_contents('test2', Path('test2'))

When the test is run with --bug-report-dir bug-reports specified, the resulting tree is:

bug-reports
└── test.tar

Also, when the test id is processed to get the file name for the bug report, the closing ] is not removed:

/tmp/pytest-of-ttoth/pytest-current
...
├── test_execute_account_nonexiste0                                                                                                                   [123/4549]
│   ├── kprint
│   └── test_execute
│       └── account-nonexistent].tar
├── test_execute_account_nonexistecurrent -> /tmp/pytest-of-ttoth/pytest-39/test_execute_account_nonexiste0
├── test_execute_branch_0
│   ├── kprint
│   └── test_execute
│       └── branch].tar
├── test_execute_branch_current -> /tmp/pytest-of-ttoth/pytest-39/test_execute_branch_0
├── test_execute_step_1_0
│   ├── kprint
│   └── test_execute
│       └── step-1].tar
├── test_execute_step_1_current -> /tmp/pytest-of-ttoth/pytest-39/test_execute_step_1_0
├── test_execute_step_2_0
│   ├── kprint
│   └── test_execute
│       └── step-2].tar
...
Dominant language
Python
Stars
591
Forks
163
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from runtimeverification/k

All issues in runtimeverification/k

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.