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

NC | Online Upgrade | Tests | Config directory restructure upgrade script unit tests #8654

Merged

Conversation

romayalon
Copy link
Contributor

@romayalon romayalon commented Jan 6, 2025

Explain the changes

  1. Added unit tests for every function in noobaa-core/src/upgrade/nc_upgrade_scripts/1.0.0/config_dir_restructure.js.
  2. config dir restructure -
  • did some small refactoring
  • added handling in removing name symlink in case the new symlink /etc/noobaa.conf.d/accounts_by_name/account1.symlink points to a wrong/non existing location and then re-creating the link correctly, added also the matching tests for this case - notice this is an artificial test and is not suppose to happen in the usual flow.
    The relevant tests for this case -
  1. create_account_name_index_if_missing() - new name index already exists and points to wrong location
  2. create_account_access_keys_index_if_missing() - new access key index already exists and points to a wrong location
  3. create_account_name_index_if_missing() - new name index already exists and points to a non existing location
  4. create_account_access_keys_index_if_missing() - new access key index already exists and points to a non existing location

Issues: Fixed #xxx / Gap #xxx

Testing Instructions:

  1. sudo jest --testRegex=jest_tests/test_config_dir_restructure_upgrade_script.test.js
  • Doc added/updated
  • Tests added

@romayalon romayalon force-pushed the romy-config-dir-restructure-tests branch 4 times, most recently from f321d16 to 2ea7b60 Compare January 7, 2025 09:19
@romayalon romayalon requested a review from shirady January 7, 2025 09:20
src/util/fs_utils.js Outdated Show resolved Hide resolved
src/util/fs_utils.js Show resolved Hide resolved
src/test/system_tests/test_utils.js Show resolved Hide resolved
src/test/system_tests/test_utils.js Outdated Show resolved Hide resolved
src/test/system_tests/test_utils.js Outdated Show resolved Hide resolved
@shirady
Copy link
Contributor

shirady commented Jan 9, 2025

@romayalon could you update the doc file of CI&Tests.md with the new tests files?

@romayalon romayalon requested a review from shirady January 13, 2025 10:20
Copy link
Contributor

@shirady shirady left a comment

Choose a reason for hiding this comment

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

LGTM
I added additional small comments

@romayalon romayalon force-pushed the romy-config-dir-restructure-tests branch from 0a01004 to e57b5c3 Compare January 14, 2025 07:55
@romayalon romayalon merged commit c171502 into noobaa:master Jan 14, 2025
11 checks passed
@romayalon romayalon mentioned this pull request Jan 16, 2025
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants