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

Wrap all JavaScript in an Immediately-Invoked Function Expression #19

Closed
wants to merge 1 commit into from

Conversation

DemiMarie
Copy link
Contributor

This ensures that variables declared in the script do not alter the enclosing scope. Yes, JavaScript is a bad language.

This ensures that variables declared in the script do not alter the
enclosing scope.  Yes, JavaScript is a bad language.
@qubesos-bot
Copy link

qubesos-bot commented Dec 15, 2024

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025010404-4.3&flavor=pull-requests

Test run included the following:

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024111705-4.3&flavor=update

  • system_tests_whonix@hw7

    • startup: Failed (test died)
      # Test died: command 'qvm-run --nogui -u root sys-firewall qvm-sync...
  • system_tests_gui_interactive@hw1

    • screenlocker_leaks: Failed (test died)
      # Test died: command 'qvm-run -p -u root work "dnf -y install mate-...
  • system_tests_suspend@hw1

    • suspend: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_basic_vm_qrexec_gui@hw7

    • startup: Failed (test died)
      # Test died: command 'qvm-run --nogui -u root sys-firewall qvm-sync...
  • system_tests_gui_tools@hw7

    • startup: Failed (test died)
      # Test died: command 'qvm-run --nogui -u root sys-firewall qvm-sync...
  • system_tests_whonix

    • whonixcheck: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_gui_tools

    • desktop_linux_manager_policy_edit: unnamed test (unknown)
    • desktop_linux_manager_policy_edit: Failed (test died)
      # Test died: no candidate needle with tag(s) 'qubes-policy-editor-g...
  • system_tests_suspend

    • suspend: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_gui_interactive

    • screenlocker_leaks: Failed (test died)
      # Test died: command 'qvm-run -p -u root work "dnf -y install mate-...
  • system_tests_guivm_gui_interactive

    • update_guivm: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_backupdispvm

    • startup: wait_serial (wait serial expected + timed out)
      # wait_serial expected: "# "...

    • startup: wait_serial (wait serial expected)
      # wait_serial expected: qr/xE1Ra-\d+-/...

    • startup: Failed (test died + timed out)
      # Test died: command 'export TERM=dumb; stty cols 2048 rows 25' tim...

    • startup: wait_serial (wait serial expected)
      # wait_serial expected: "# "...

    • startup: wait_serial (wait serial expected)
      # wait_serial expected: qr/2E8vz-\d+-/...

  • system_tests_kde_gui_interactive

    • kde_install: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_guivm_vnc_gui_interactive

    • update_guivm: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_basic_vm_qrexec_gui_btrfs

    • switch_pool: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_basic_vm_qrexec_gui_ext4

    • switch_pool: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_basic_vm_qrexec_gui_xfs

    • switch_pool: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...

Failed tests

22 failures
  • system_tests_whonix@hw7

    • startup: Failed (test died)
      # Test died: command 'qvm-run --nogui -u root sys-firewall qvm-sync...
  • system_tests_gui_interactive@hw1

    • screenlocker_leaks: Failed (test died)
      # Test died: command 'qvm-run -p -u root work "dnf -y install mate-...
  • system_tests_suspend@hw1

    • suspend: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_basic_vm_qrexec_gui@hw7

    • startup: Failed (test died)
      # Test died: command 'qvm-run --nogui -u root sys-firewall qvm-sync...
  • system_tests_gui_tools@hw7

    • startup: Failed (test died)
      # Test died: command 'qvm-run --nogui -u root sys-firewall qvm-sync...
  • system_tests_whonix

    • whonixcheck: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_gui_tools

    • desktop_linux_manager_policy_edit: unnamed test (unknown)
    • desktop_linux_manager_policy_edit: Failed (test died)
      # Test died: no candidate needle with tag(s) 'qubes-policy-editor-g...
  • system_tests_suspend

    • suspend: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_gui_interactive

    • screenlocker_leaks: Failed (test died)
      # Test died: command 'qvm-run -p -u root work "dnf -y install mate-...
  • system_tests_guivm_gui_interactive

    • update_guivm: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_backupdispvm

    • startup: wait_serial (wait serial expected + timed out)
      # wait_serial expected: "# "...

    • startup: wait_serial (wait serial expected)
      # wait_serial expected: qr/xE1Ra-\d+-/...

    • startup: Failed (test died + timed out)
      # Test died: command 'export TERM=dumb; stty cols 2048 rows 25' tim...

    • startup: wait_serial (wait serial expected)
      # wait_serial expected: "# "...

    • startup: wait_serial (wait serial expected)
      # wait_serial expected: qr/2E8vz-\d+-/...

  • system_tests_kde_gui_interactive

    • kde_install: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_basic_vm_qrexec_gui_zfs

    • switch_pool: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_guivm_vnc_gui_interactive

    • update_guivm: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_basic_vm_qrexec_gui_btrfs

    • switch_pool: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_basic_vm_qrexec_gui_ext4

    • switch_pool: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...
  • system_tests_basic_vm_qrexec_gui_xfs

    • switch_pool: Failed (test died)
      # Test died: command 'qvm-run --no-gui -p -u root sys-net "command ...

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/119126#dependencies

3 fixed
  • system_tests_audio@hw1

  • system_tests_extra

    • TC_00_QVCTest_whonix-gateway-17: test_010_screenshare (failure)
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^... AssertionError: 0 == 0
  • system_tests_kde_gui_interactive

    • gui_keyboard_layout: Failed (test died)
      # Test died: command 'test "$(cd ~user;ls e1*)" = "$(qvm-run -p wor...

Unstable tests

  • system_tests_update@hw1

    update2/Failed (1/5 times with errors)
    • job 121711 # Test died: command '(set -o pipefail; qubesctl --show-output stat...
  • system_tests_update@hw7

    update2/Failed (1/5 times with errors)
    • job 121711 # Test died: command '(set -o pipefail; qubesctl --show-output stat...
  • system_tests_update

    update2/Failed (1/5 times with errors)
    • job 121711 # Test died: command '(set -o pipefail; qubesctl --show-output stat...

@marmarek
Copy link
Member

marmarek commented Jan 4, 2025

None of the upstream scripts in there have constructs like this, and documentation doesn't recommend it either. Does this PR fixes some specific issue?

@DemiMarie
Copy link
Contributor Author

No, this PR does not fix any specific issue. There was either a comment or a past commit message mentioning that variable scope was unclear, and this does fix that. The purpose is to prevent future changes from shadowing or clobbering some critical variable and introducing a bug that would be extremely hard to track down.

@marmarek
Copy link
Member

marmarek commented Jan 6, 2025

Plasma people said each script gets isolated scope, so this is not needed.

@marmarek marmarek closed this Jan 6, 2025
@DemiMarie
Copy link
Contributor Author

That is great! Do you have a link to the discussion @marmarek?

@DemiMarie DemiMarie deleted the iife branch January 7, 2025 05:09
@marmarek
Copy link
Member

marmarek commented Jan 7, 2025

That is great! Do you have a link to the discussion @marmarek?

A question on the plasma matrix channel, I believe you are there too.

@marmarek
Copy link
Member

marmarek commented Jan 7, 2025

I have no idea how to open this link (on a desktop client), but this is the message link: https://matrix.to/#/!gYaaEyvNWxTzXssOmq:kde.org/$4sVVYWLfQ1NcgslQJvy7wpnUw1gHA8sv90OgAy5Fyro?via=matrix.org&via=kde.org&via=im.kde.org

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