Example #1
0
    def wrapper(wrapped_method, instance, args, kwargs):
        executor_settings = settings.FLOW_EXECUTOR.copy()
        executor_settings.update(custom_executor_settings)

        try:
            with override_settings(FLOW_EXECUTOR=executor_settings):
                # Re-run engine discovery as the settings have changed.
                manager.discover_engines()

                # Run the actual unit test method.
                return wrapped_method(*args, **kwargs)
        finally:
            # Re-run engine discovery as the settings have changed.
            manager.discover_engines()
Example #2
0
    def wrapper(*args, **kwargs):
        executor_settings = settings.FLOW_EXECUTOR.copy()
        executor_settings.update({
            'NAME': 'resolwe.flow.executors.docker',
            'CONTAINER_IMAGE': 'resolwe/test:base'
        })

        try:
            with override_settings(FLOW_EXECUTOR=executor_settings):
                # Re-run engine discovery as the settings have changed.
                manager.discover_engines()

                # Run the actual unit test method.
                method(*args, **kwargs)
        finally:
            # Re-run engine discovery as the settings have changed.
            manager.discover_engines()
Example #3
0
    def wrapper(wrapped_method, instance, args, kwargs):
        from resolwe.flow.managers import manager  # To prevent circular imports.

        executor_settings = settings.FLOW_EXECUTOR.copy()
        executor_settings.update(custom_executor_settings)

        try:
            with override_settings(FLOW_EXECUTOR=executor_settings):
                manager.discover_engines()

                # Re-run the post_register_hook
                manager.get_executor().post_register_hook(verbosity=0)

                # Run the actual unit test method.
                return wrapped_method(*args, **kwargs)
        finally:
            # Re-run engine discovery as the settings have changed.
            manager.discover_engines()
Example #4
0
    def wrapper(wrapped_method, instance, args, kwargs):
        from resolwe.flow.managers import manager  # To prevent circular imports.

        executor_settings = settings.FLOW_EXECUTOR.copy()
        executor_settings.update(custom_executor_settings)

        try:
            with override_settings(FLOW_EXECUTOR=executor_settings):
                with manager.override_settings(FLOW_EXECUTOR=executor_settings):
                    # Re-run engine discovery as the settings have changed.
                    manager.discover_engines()

                    # Re-run the post_register_hook
                    manager.get_executor().post_register_hook(verbosity=0)

                    # Run the actual unit test method.
                    return wrapped_method(*args, **kwargs)
        finally:
            # Re-run engine discovery as the settings have changed.
            manager.discover_engines()