Skip to content

Issue in loading step impls from another project using relative paths since a past update #429

Closed

Description

@kunalvishwasrao

Hello,

A couple of months back I had submitted a PR to add the feature for "Correctly loading the methods from relatively imported classes" and updated "getgauge/impl_loader.py" file's update_step_resgistry_with_class(instance, file_path) method to check if the file_path had ".." and resolve it to its absolute path. This check was added for efficiency to reduce execution time.

The check was kept as if '..' in file_path because we give the relative paths in the python.properties file (../common_project/step_imp) of the project which when passed to the impl_loader file is prepended with the project folder name and ultimately becomes like: <CURRET_PROJECT_DIR>/../common_project/step_impl (For detailed project structure info and values of python.properties file please refer issue #359

But apparently this check was changed to if str(file_path).startswith("..") in the following PR - Enable test coverage report according to README which returns false for the above mentioned scenario due to which the step implementations from other projects are unable to load

This issue sneaked past the unit tests of impl_loader too as there was no test to cover the scenario where the file name was like <CURRET_PROJECT_DIR>/../common_project/step_impl

I'll create a PR with the fix for this issue and updating the unit tests to handle this scenario as well.

Thanks! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions