Skip to content

Update integration tests for jquery3 part 2#424

Merged
adamruzicka merged 2 commits intomasterfrom
update_tests_jquery3
Jul 8, 2025
Merged

Update integration tests for jquery3 part 2#424
adamruzicka merged 2 commits intomasterfrom
update_tests_jquery3

Conversation

@nadjaheitmann
Copy link
Copy Markdown
Collaborator

For some reason, the integration tests were not run on the second push in #423, which we realized only after merging. So here is a fixup PR.

@nadjaheitmann nadjaheitmann force-pushed the update_tests_jquery3 branch 2 times, most recently from f1f733c to 6e6fce4 Compare May 15, 2025 09:46
@nadjaheitmann nadjaheitmann force-pushed the update_tests_jquery3 branch from 6e6fce4 to a41b44e Compare May 15, 2025 09:51
@nadjaheitmann
Copy link
Copy Markdown
Collaborator Author

@MariaAga Do you have any idea why the integration tests are failing and how to fix it? https://github.com/theforeman/foreman_puppet/actions/runs/15041967945/job/42275651182?pr=424#step:21:30

We tried to debug it but could not reproduce the error locally.

@MariaAga
Copy link
Copy Markdown
Member

This took awhile, so recording the debugging:
in foreman core, application.js, to find which tooltip is even hiding the select:

function onContentLoad() {
const targetNode = document.querySelector('body');
const config = { attributes: true, childList: true, subtree: true };
const callback = (mutationList, observer) => {
  for (const mutation of mutationList) {
    if (mutation.type === "childList") {
      mutation.addedNodes.forEach( n =>
      {
        if (n?.classList?.length && [...n.classList].includes('tooltip')){
          console.log('TOOLTIPHERE')
           console.log(n.innerHTML)
        }
      }
      )
  }
};

const observer = new MutationObserver(callback);
observer.observe(targetNode, config);

Then I ran bundle exec rake test:foreman_puppet TEST=../foreman_puppet/test/integration/foreman_puppet/host_js_test.rb TESTOPTS="--name=/inherit/" SHOW_JS_LOG=1
and it logged the env select choices

I tried clicking in random places before and after the OS tab change and nothing helped.
I decided to remove the tooltips here: theforeman/foreman#10546

BTW:
I tried to reproduce it locally and never saw the tooltip not being hidden, but I did see an error when selecting the puppet env in the host form in this function: updatePuppetclasses
so looks like we need to change the line in this function to have a condition: if (url?.match('hostgroups')) {

@nadjaheitmann
Copy link
Copy Markdown
Collaborator Author

Thanks @MariaAga , I had the PR running against your PR and it runs fine now.

@adamruzicka
Copy link
Copy Markdown
Contributor

@nadjaheitmann The PR in foreman was merged, could you please drop 5364155 ?

@nadjaheitmann nadjaheitmann force-pushed the update_tests_jquery3 branch from 02196ce to 0719026 Compare July 8, 2025 11:48
@adamruzicka
Copy link
Copy Markdown
Contributor

The test failures were not introduced here, opened #425 to address that

@adamruzicka adamruzicka merged commit 66f3b1f into master Jul 8, 2025
13 of 16 checks passed
@adamruzicka
Copy link
Copy Markdown
Contributor

Thank you @nadjaheitmann !

@adamruzicka adamruzicka deleted the update_tests_jquery3 branch July 8, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants