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

SAT: verify AIRBYTE_ENTRYPOINT is defined #4478

Merged
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
69aa7a6
save changes required for work; TODO locate all places that need to b…
vovavovavovavova Jul 1, 2021
fd4db49
Merge remote-tracking branch 'origin/master' into valdemar/#4262_asse…
vovavovavovavova Jul 1, 2021
1da955d
move new test inside test_spec
vovavovavovavova Jul 1, 2021
075a044
apply suggestions
vovavovavovavova Jul 2, 2021
9b66d50
change return type + add check env = space_joined_entrypoint
vovavovavovavova Jul 2, 2021
ad4274a
requested
vovavovavovavova Jul 2, 2021
472ad1a
add check entrypoint with env
vovavovavovavova Jul 2, 2021
b62ae92
bump SAT --version && changelog update
vovavovavovavova Jul 2, 2021
62f84d5
Merge remote-tracking branch 'origin/master' into valdemar/#4262_asse…
vovavovavovavova Jul 2, 2021
a2ba9b6
merge && fix changelog
vovavovavovavova Jul 2, 2021
b143ad5
changes
vovavovavovavova Jul 5, 2021
b74e6ff
add dynamic docker runner creator + test having properties
vovavovavovavova Jul 6, 2021
076d31e
update the names
vovavovavovavova Jul 6, 2021
d5da978
change names
vovavovavovavova Jul 6, 2021
28505cc
make fixtures
vovavovavovavova Jul 6, 2021
7ab4c81
Merge remote-tracking branch 'origin/master' into valdemar/#4262_asse…
vovavovavovavova Jul 6, 2021
214209b
upd text
vovavovavovavova Jul 6, 2021
d4b6d4f
Update airbyte-integrations/bases/source-acceptance-test/unit_tests/t…
vovavovavovavova Jul 7, 2021
770b508
requested changes
vovavovavovavova Jul 7, 2021
6f52aed
Update airbyte-integrations/bases/source-acceptance-test/unit_tests/t…
vovavovavovavova Jul 7, 2021
b9991f1
Update airbyte-integrations/bases/source-acceptance-test/unit_tests/t…
vovavovavovavova Jul 7, 2021
387493c
apply requested changes
vovavovavovavova Jul 7, 2021
36f76f9
change names (requested)
vovavovavovavova Jul 7, 2021
c6e2bd4
move binary strings to standard with convertation in builder
vovavovavovavova Jul 7, 2021
045c749
fixing merge-conflict side effect
vovavovavovavova Jul 7, 2021
64a811b
resolve new conflict (both)
vovavovavovavova Jul 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ Add test whether PKs present and not None if `source_defined_primary_key` define

## 0.1.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you correct these version headers?

Add configurable timeout for the acceptance tests: https://github.com/airbytehq/airbyte/pull/4296

## 0.1.7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in reverse chrono order

Add: `test_spec` additionally checks if Dockerfile has `ENV AIRBYTE_ENTRYPOINT` defined
and equal to space_joined `ENTRYPOINT`
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY setup.py ./
COPY pytest.ini ./
RUN pip install .

LABEL io.airbyte.version=0.1.6
LABEL io.airbyte.version=0.1.7
LABEL io.airbyte.name=airbyte/source-acceptance-test

ENTRYPOINT ["python", "-m", "pytest", "-p", "source_acceptance_test.plugin"]
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def test_spec(self, connector_spec: ConnectorSpecification, docker_runner: Conne
if connector_spec:
assert spec_messages[0].spec == connector_spec, "Spec should be equal to the one in spec.json file"

assert docker_runner.env_variables.get("AIRBYTE_ENTRYPOINT"), "AIRBYTE_ENTRYPOINT must be set in dockerfile"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪🏼

assert docker_runner.env_variables.get("AIRBYTE_ENTRYPOINT") == " ".join(
docker_runner.entry_point
), "env should be equal to space-joined entrypoint"


@pytest.mark.default_timeout(30)
class TestConnection(BaseTest):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,12 @@ def run(self, cmd, config=None, state=None, catalog=None, **kwargs) -> Iterable[
yield AirbyteMessage.parse_raw(line)
except ValidationError as exc:
logging.warning("Unable to parse connector's output %s", exc)

@property
def env_variables(self):
env_vars = self._image.attrs["Config"]["Env"]
return {env.split("=", 1)[0]: env.split("=", 1)[1] for env in env_vars}

@property
def entry_point(self):
return self._image.attrs["Config"]["Entrypoint"]