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 custom integration python job #790

Merged
merged 4 commits into from
Aug 19, 2021
Merged

Conversation

Shrews
Copy link
Contributor

@Shrews Shrews commented Aug 12, 2021

Changes the tox py38 job to also parent to ansible-buildset-registry-consumer which will get us a container environment (either docker or podman) on the test node. This will cause several more tests, which are skipped if neither docker nor podman are installed, to actually run.

Removes the following (now failing) tests that were left in when adhoc and playbook commands were removed:

  • test_adhoc_localhost_setup
  • test_playbook_with_private_data_dir
  • test_playbook_with_relative_path

The following tests were being skipped:

  • test/integration/test_events.py::test_async_events
  • test/integration/test_events.py::test_profile_data
  • test/integration/test_display_callback.py::test_callback_plugin_records_notify_events[playbook0]
  • test/integration/test_interface.py::test_run_script_within_container
  • test/integration/test_interface.py::test_get_plugin_docs_within_container
  • test/integration/test_events.py::test_basic_events[True]
  • test/integration/test_interface.py::test_run_ansible_command_within_container
  • test/integration/test_interface.py::test_get_inventory_within_container
  • test/integration/test_interface.py::test_get_plugin_docs_list_within_container
  • test/integration/test_transmit_worker_process.py::TestStreamingUsage::test_remote_job_by_sockets[adhoc]
  • test/integration/test_transmit_worker_process.py::TestStreamingUsage::test_remote_job_by_sockets[run]
  • test/integration/test_interface.py::test_env_accuracy_inside_container
  • test/integration/containerized/test_cli_containerized.py::test_module_run
  • test/integration/containerized/test_cli_containerized.py::test_playbook_run
  • test/integration/containerized/test_cli_containerized.py::test_provide_env_var
  • test/integration/containerized/test_cli_containerized.py::test_adhoc_localhost_setup
  • test/integration/containerized/test_cli_containerized.py::test_playbook_with_private_data_dir
  • test/integration/containerized/test_cli_containerized.py::test_playbook_with_relative_path
  • test/integration/containerized/test_container_management.py::test_cancel_will_remove_container

After this change, this is the remaining set of skipped tests:

  • test/integration/test_events.py::test_async_events[True]
  • test/integration/test_events.py::test_profile_data
  • test/integration/test_display_callback.py::test_callback_plugin_records_notify_events[playbook0]
  • test/integration/test_events.py::test_basic_events[True]
  • test/integration/containerized/test_cli_containerized.py::test_module_run (requires podman)
  • test/integration/containerized/test_cli_containerized.py::test_playbook_run (requires podman)
  • test/integration/containerized/test_cli_containerized.py::test_provide_env_var (requires podman)

@pabelanger
Copy link
Contributor

recheck

@Shrews Shrews force-pushed the integration_job branch 5 times, most recently from bba6ff4 to f0c2ebe Compare August 18, 2021 20:17
@Shrews Shrews changed the title WIP: Add custom integration python job Add custom integration python job Aug 18, 2021
@Shrews
Copy link
Contributor Author

Shrews commented Aug 18, 2021

test/integration/containerized/test_container_management.py::test_cancel_will_remove_container is the lone test failure here.

Seems podman ps -aq --filter name=ansible_runner_foo_bar is failing on the test node, returning a rc=125. Likely because the container does not exist, which is what the test is expecting. This is not reproducible on a newer OS (I get rc=0), so I'm guessing an older version of podman is in use here and it's been changed so that no longer gives an error on unknown containers?

@pabelanger I could not find the version of podman in use in the test logs. Any idea how I could figure that out?

@Shrews
Copy link
Contributor Author

Shrews commented Aug 19, 2021

recheck

1 similar comment
@Shrews
Copy link
Contributor Author

Shrews commented Aug 19, 2021

recheck

@Shrews
Copy link
Contributor Author

Shrews commented Aug 19, 2021

recheck

@Shrews Shrews added the gate label Aug 19, 2021
Copy link
Contributor

@ansible-zuul ansible-zuul bot left a comment

Choose a reason for hiding this comment

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

LGTM!

@ansible-zuul ansible-zuul bot merged commit c654d1c into ansible:devel Aug 19, 2021
@Shrews Shrews deleted the integration_job branch August 19, 2021 19:13
@patchback
Copy link

patchback bot commented Sep 23, 2021

Backport to release_2.0: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply c654d1c on top of patchback/backports/release_2.0/c654d1cb821c06352170e7c189f4487eaa746702/pr-790

Backporting merged PR #790 into devel

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/ansible-runner.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/release_2.0/c654d1cb821c06352170e7c189f4487eaa746702/pr-790 upstream/release_2.0
  4. Now, cherry-pick PR Add custom integration python job #790 contents into that branch:
    $ git cherry-pick -x c654d1cb821c06352170e7c189f4487eaa746702
    If it'll yell at you with something like fatal: Commit c654d1cb821c06352170e7c189f4487eaa746702 is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x c654d1cb821c06352170e7c189f4487eaa746702
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Add custom integration python job #790 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/release_2.0/c654d1cb821c06352170e7c189f4487eaa746702/pr-790
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Shrews pushed a commit to Shrews/ansible-runner that referenced this pull request Sep 27, 2021
Add custom integration python job

Changes the tox py38 job to also parent to ansible-buildset-registry-consumer which will get us a container environment (either docker or podman) on the test node.  This will cause several more tests, which are skipped if neither docker nor podman are installed, to actually run.
Removes the following (now failing) tests that were left in when adhoc and playbook commands were removed:

test_adhoc_localhost_setup
test_playbook_with_private_data_dir
test_playbook_with_relative_path

The following tests were being skipped:

test/integration/test_events.py::test_async_events
test/integration/test_events.py::test_profile_data
test/integration/test_display_callback.py::test_callback_plugin_records_notify_events[playbook0]
test/integration/test_interface.py::test_run_script_within_container
test/integration/test_interface.py::test_get_plugin_docs_within_container
test/integration/test_events.py::test_basic_events[True]
test/integration/test_interface.py::test_run_ansible_command_within_container
test/integration/test_interface.py::test_get_inventory_within_container
test/integration/test_interface.py::test_get_plugin_docs_list_within_container
test/integration/test_transmit_worker_process.py::TestStreamingUsage::test_remote_job_by_sockets[adhoc]
test/integration/test_transmit_worker_process.py::TestStreamingUsage::test_remote_job_by_sockets[run]
test/integration/test_interface.py::test_env_accuracy_inside_container
test/integration/containerized/test_cli_containerized.py::test_module_run
test/integration/containerized/test_cli_containerized.py::test_playbook_run
test/integration/containerized/test_cli_containerized.py::test_provide_env_var
test/integration/containerized/test_cli_containerized.py::test_adhoc_localhost_setup
test/integration/containerized/test_cli_containerized.py::test_playbook_with_private_data_dir
test/integration/containerized/test_cli_containerized.py::test_playbook_with_relative_path
test/integration/containerized/test_container_management.py::test_cancel_will_remove_container

After this change, this is the remaining set of skipped tests:

test/integration/test_events.py::test_async_events[True]
test/integration/test_events.py::test_profile_data
test/integration/test_display_callback.py::test_callback_plugin_records_notify_events[playbook0]
test/integration/test_events.py::test_basic_events[True]

Reviewed-by: Paul Belanger <None>
Reviewed-by: David Shrewsbury <None>
Reviewed-by: Shane McDonald <me@shanemcd.com>
Reviewed-by: None <None>
(cherry picked from commit c654d1c)
ansible-zuul bot added a commit that referenced this pull request Sep 27, 2021
[release_2.0] Backport integration test

Backports of:

PR #790 - Add custom integration python job
PR #796 - Migrate container jobs to centos-8-stream nodeset
PR #797 - Tune tox.ini
PR #798 - Rework bindep.txt files
PR #801 - Small change to properly test containers

Reviewed-by: Shane McDonald <me@shanemcd.com>
Reviewed-by: None <None>
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.

3 participants