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

Source Facebook Marketing: SAT fails in TestConnection.test_check() #5592

Closed
Zirochkaa opened this issue Aug 24, 2021 · 1 comment · Fixed by #5621
Closed

Source Facebook Marketing: SAT fails in TestConnection.test_check() #5592

Zirochkaa opened this issue Aug 24, 2021 · 1 comment · Fixed by #5621

Comments

@Zirochkaa
Copy link
Contributor

Current Behavior

Code throwing an error (see logs).

Expected Behavior

Code should run tests as usual.

Logs

LOG

Test session starts (platform: darwin, Python 3.8.6, pytest 6.1.2, pytest-sugar 0.9.4)
cachedir: .pytest_cache
rootdir: /Users/oleh/Dropbox/work/zazmic/airbyte, configfile: pytest.ini
plugins: sugar-0.9.4, timeout-1.4.2
collecting ...
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_match_expected[inputs0] ✓                                                8% ▊
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_required[inputs0] ✓                                                     15% █▋
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_optional[inputs0] ✓                                                     23% ██▍
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_has_secret[inputs0] ✓                                                   31% ███▏
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_secret_never_in_the_output[inputs0] ✓                                   38% ███▉
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestConnection.test_check[inputs0] ✓                                                  46% ████▋

――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― TestConnection.test_check[inputs1] ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

self = <source_acceptance_test.tests.test_core.TestConnection object at 0x116df98e0>, connector_config = SecretDict(******)
inputs = ConnectionTestConfig(config_path='integration_tests/invalid_config.json', status=<Status.Failed: 'failed'>, timeout_seconds=None)
docker_runner = <source_acceptance_test.utils.connector_runner.ConnectorRunner object at 0x116de31c0>

    def test_check(self, connector_config, inputs: ConnectionTestConfig, docker_runner: ConnectorRunner):
        if inputs.status == ConnectionTestConfig.Status.Succeed:
            output = docker_runner.call_check(config=connector_config)
            con_messages = filter_output(output, Type.CONNECTION_STATUS)

            assert len(con_messages) == 1, "Connection status message should be emitted exactly once"
            assert con_messages[0].connectionStatus.status == Status.SUCCEEDED
        elif inputs.status == ConnectionTestConfig.Status.Failed:
>           output = docker_runner.call_check(config=connector_config)

../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:90:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../bases/source-acceptance-test/source_acceptance_test/utils/connector_runner.py:92: in call_check
    output = list(self.run(cmd=cmd, config=config, **kwargs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <source_acceptance_test.utils.connector_runner.ConnectorRunner object at 0x116de31c0>, cmd = 'check --config tap_config.json', config = SecretDict(******), state = None, catalog = None
kwargs = {}
volumes = {'/private/var/folders/64/zjkgzn812mb91bpbtw1by46c0000gn/T/pytest-of-oleh/pytest-72/test_check_inputs1_0/run_1/input':...2mb91bpbtw1by46c0000gn/T/pytest-of-oleh/pytest-72/test_check_inputs1_0/run_1/output': {'bind': '/local', 'mode': 'rw'}}
patched_error = ContainerError("Command 'check --config tap_config.json' in image 'sha256:7050be14579899ddcfc7da99a9321cf33d148d3ec245ef6ceaced24c1e36b001' returned non-zero exit status 1: ")

    def run(self, cmd, config=None, state=None, catalog=None, **kwargs) -> Iterable[AirbyteMessage]:
        self._runs += 1
        volumes = self._prepare_volumes(config, state, catalog)
        logging.info("Docker run: \n%s\ninput: %s\noutput: %s", cmd, self.input_folder, self.output_folder)
        try:
            logs = self._client.containers.run(
                image=self._image, command=cmd, working_dir="/data", volumes=volumes, network="host", stdout=True, stderr=True, **kwargs
            )
        except ContainerError as err:
            # beautify error from container
            patched_error = ContainerError(
                container=err.container, exit_status=err.exit_status, command=err.command, image=err.image, stderr=err.stderr.decode()
            )
>           raise patched_error from None  # get rid of any previous exception stack
E           docker.errors.ContainerError: Command 'check --config tap_config.json' in image 'sha256:7050be14579899ddcfc7da99a9321cf33d148d3ec245ef6ceaced24c1e36b001' returned non-zero exit status 1:

../../bases/source-acceptance-test/source_acceptance_test/utils/connector_runner.py:123: ContainerError
--------------------------------------------------------------------------------------- Captured log call ----------------------------------------------------------------------------------------
INFO     root:connector_runner.py:113 Docker run:
check --config tap_config.json
input: /private/var/folders/64/zjkgzn812mb91bpbtw1by46c0000gn/T/pytest-of-oleh/pytest-72/test_check_inputs1_0/run_1/input
output: /private/var/folders/64/zjkgzn812mb91bpbtw1by46c0000gn/T/pytest-of-oleh/pytest-72/test_check_inputs1_0/run_1/output


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> captured log >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
INFO     root:connector_runner.py:113 Docker run:
check --config tap_config.json
input: /private/var/folders/64/zjkgzn812mb91bpbtw1by46c0000gn/T/pytest-of-oleh/pytest-72/test_check_inputs1_0/run_1/input
output: /private/var/folders/64/zjkgzn812mb91bpbtw1by46c0000gn/T/pytest-of-oleh/pytest-72/test_check_inputs1_0/run_1/output
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

self = <source_acceptance_test.tests.test_core.TestConnection object at 0x116df98e0>, connector_config = SecretDict(******)
inputs = ConnectionTestConfig(config_path='integration_tests/invalid_config.json', status=<Status.Failed: 'failed'>, timeout_seconds=None)
docker_runner = <source_acceptance_test.utils.connector_runner.ConnectorRunner object at 0x116de31c0>

    def test_check(self, connector_config, inputs: ConnectionTestConfig, docker_runner: ConnectorRunner):
        if inputs.status == ConnectionTestConfig.Status.Succeed:
            output = docker_runner.call_check(config=connector_config)
            con_messages = filter_output(output, Type.CONNECTION_STATUS)

            assert len(con_messages) == 1, "Connection status message should be emitted exactly once"
            assert con_messages[0].connectionStatus.status == Status.SUCCEEDED
        elif inputs.status == ConnectionTestConfig.Status.Failed:
>           output = docker_runner.call_check(config=connector_config)

../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:90:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../bases/source-acceptance-test/source_acceptance_test/utils/connector_runner.py:92: in call_check
    output = list(self.run(cmd=cmd, config=config, **kwargs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <source_acceptance_test.utils.connector_runner.ConnectorRunner object at 0x116de31c0>, cmd = 'check --config tap_config.json', config = SecretDict(******), state = None, catalog = None
kwargs = {}
volumes = {'/private/var/folders/64/zjkgzn812mb91bpbtw1by46c0000gn/T/pytest-of-oleh/pytest-72/test_check_inputs1_0/run_1/input':...2mb91bpbtw1by46c0000gn/T/pytest-of-oleh/pytest-72/test_check_inputs1_0/run_1/output': {'bind': '/local', 'mode': 'rw'}}
patched_error = ContainerError("Command 'check --config tap_config.json' in image 'sha256:7050be14579899ddcfc7da99a9321cf33d148d3ec245ef6ceaced24c1e36b001' returned non-zero exit status 1: ")

    def run(self, cmd, config=None, state=None, catalog=None, **kwargs) -> Iterable[AirbyteMessage]:
        self._runs += 1
        volumes = self._prepare_volumes(config, state, catalog)
        logging.info("Docker run: \n%s\ninput: %s\noutput: %s", cmd, self.input_folder, self.output_folder)
        try:
            logs = self._client.containers.run(
                image=self._image, command=cmd, working_dir="/data", volumes=volumes, network="host", stdout=True, stderr=True, **kwargs
            )
        except ContainerError as err:
            # beautify error from container
            patched_error = ContainerError(
                container=err.container, exit_status=err.exit_status, command=err.command, image=err.image, stderr=err.stderr.decode()
            )
>           raise patched_error from None  # get rid of any previous exception stack
E           docker.errors.ContainerError: Command 'check --config tap_config.json' in image 'sha256:7050be14579899ddcfc7da99a9321cf33d148d3ec245ef6ceaced24c1e36b001' returned non-zero exit status 1:

../../bases/source-acceptance-test/source_acceptance_test/utils/connector_runner.py:123: ContainerError
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /Users/oleh/Dropbox/work/zazmic/airbyte/airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/utils/connector_runner.py(123)run()
-> raise patched_error from None  # get rid of any previous exception stack
(Pdb) exit

==================================================================================== short test summary info =====================================================================================
FAILED ../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestConnection::test_check[inputs1] - docker.errors.ContainerError: Command 'check --config tap_config.jso...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! _pytest.outcomes.Exit: Quitting debugger !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Results (12.29s):
       6 passed
       1 failed
         - airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:82 TestConnection.test_check[inputs1]

Steps to Reproduce

  1. Build source image - docker build . -t airbyte/source-facebook-marketing:dev
  2. Run tests - python -m pytest -p integration_tests.acceptance --pdb

Are you willing to submit a PR?

Yes.

@Zirochkaa
Copy link
Contributor Author

Link to the ticket in zira is here.

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

Successfully merging a pull request may close this issue.

4 participants