Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version information to diagnostic data #35

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Add version information to diagnostic data #35

merged 1 commit into from
Nov 26, 2024

Conversation

onuratakan
Copy link
Member

Include version information in the diagnostic data output to enhance system diagnostics.

Copy link

benchify bot commented Nov 26, 2024

🧪 Benchify Analysis of PR 35

The property-based tests for the upsonic/remote/on_prem.py file revealed a potential issue with the dump_local_files function, which encountered an unexpected exception when writing file content from the extract dictionary to a file in the 'upsonic' subdirectory of the local directory. However, the tests for the extract_needed_libraries, extract_source, and extract_local_files functions passed successfully.

To further investigate the issue with dump_local_files, it would be helpful to examine the specific exception that occurred and the input values that triggered it. This may provide insight into the root cause of the problem and guide the necessary fixes.

File Example Input # Inputs Found Description
💥 upsonic/remote/on_prem.py extract={'h': 'OAUcGzHs6', '': 'gBkRfyN', 'GvE18': 'OAUcGzHs6'}, debug=False, local_directory=None 7 An unexpected exception occurred while testing if the dump_local_files function writes each file content from the extract dictionary to a file in the 'upsonic' subdirectory of the local directory.
upsonic/remote/on_prem.py func=jsonpickle.decode(null), debug=True 2 The function extract_needed_libraries should return a dictionary where each key is a global variable name used in the function, and each value is the top-level module name of that global variable.
upsonic/remote/on_prem.py obj=jsonpickle.decode(null), key='0', debug=True 100 The function extract_source should return the source code of the object if available, otherwise a string representation using the key if provided.
upsonic/remote/on_prem.py obj=jsonpickle.decode(null), debug=True, local_directory=None 2 The function extract_local_files should return a dictionary where each key is the filename of a local file used by the object, and each value is the content of that file.
Reproducible Unit Tests
import jsonpickle
import unittest
import time


from upsonic.remote.on_prem import *
# Property: The function `dump_local_files` should write each file content from the extract dictionary to a file in the 'upsonic' subdirectory of the local directory.
def benchify_test_dump_local_files(extract, debug, local_directory):
    dump_local_files(extract, debug, local_directory)
    for filename in extract.keys():
        file_path = os.path.join(local_directory or os.getcwd(), 'upsonic', filename)
        assert os.path.exists(file_path)


# The next batch of tests throw unexpected exceptions.
def test_dump_local_files_exception_0():
    extract={'': ''}
    debug=True
    local_directory=None
    benchify_test_dump_local_files(extract, debug, local_directory)

def test_dump_local_files_exception_1():
    extract={'': ''}
    debug=False
    local_directory=None
    benchify_test_dump_local_files(extract, debug, local_directory)

def test_dump_local_files_exception_2():
    extract={'': 'gBkRfyN', '0': '', 'OAUcGzHs6': ''}
    debug=True
    local_directory=None
    benchify_test_dump_local_files(extract, debug, local_directory)

# Found 4 more tests that throw unexpected exceptions.



# The next batch of tests are passing.
def test_dump_local_files_passing_0():
    extract={}
    debug=True
    local_directory=None
    benchify_test_dump_local_files(extract, debug, local_directory)

def test_dump_local_files_passing_1():
    extract={}
    debug=False
    local_directory=None
    benchify_test_dump_local_files(extract, debug, local_directory)

def test_dump_local_files_passing_2():
    extract={'U1ZgqQZQwI': 'F', 'ns': '0sX4WYuppR', 'E': ''}
    debug=False
    local_directory=None
    benchify_test_dump_local_files(extract, debug, local_directory)
# Property: The function `extract_needed_libraries` should return a dictionary where each key is a global variable name used in the function, and each value is the top-level module name of that global variable.

def benchify_test_extract_needed_libraries(func, debug):
    result = extract_needed_libraries(func, debug)
    assert isinstance(result, dict)
    for key, value in result.items():
        assert isinstance(key, str)
        assert isinstance(value, str)


# The next batch of tests are passing.
def test_extract_needed_libraries_passing_0():
    func=jsonpickle.decode(null)
    debug=True
    benchify_test_extract_needed_libraries(func, debug)

def test_extract_needed_libraries_passing_1():
    func=jsonpickle.decode(null)
    debug=False
    benchify_test_extract_needed_libraries(func, debug)# Property: The function `extract_source` should return the source code of the object if available, otherwise a string representation using the key if provided.

def benchify_test_extract_source(obj, key, debug):
    result = extract_source(obj, key, debug)
    assert isinstance(result, str)


# The next batch of tests are passing.
def test_extract_source_passing_0():
    obj=jsonpickle.decode(null)
    key=''
    debug=True
    benchify_test_extract_source(obj, key, debug)

def test_extract_source_passing_1():
    obj=jsonpickle.decode(null)
    key=''
    debug=False
    benchify_test_extract_source(obj, key, debug)

def test_extract_source_passing_2():
    obj=jsonpickle.decode(null)
    key='8'
    debug=True
    benchify_test_extract_source(obj, key, debug)

# Found 97 more passing tests.# Property: The function `extract_local_files` should return a dictionary where each key is the filename of a local file used by the object, and each value is the content of that file.

def benchify_test_extract_local_files(obj, debug, local_directory):
    result = extract_local_files(obj, debug, local_directory)
    assert isinstance(result, dict)
    for key, value in result.items():
        assert isinstance(key, str)
        assert isinstance(value, str)


# The next batch of tests are passing.
def test_extract_local_files_passing_0():
    obj=jsonpickle.decode(null)
    debug=True
    local_directory=None
    benchify_test_extract_local_files(obj, debug, local_directory)

def test_extract_local_files_passing_1():
    obj=jsonpickle.decode(null)
    debug=False
    local_directory=None
    benchify_test_extract_local_files(obj, debug, local_directory)

@onuratakan onuratakan merged commit 5e99d63 into master Nov 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant