Skip to content

make unit tests more robust (REVIEW)#1167

Merged
boegel merged 31 commits intoeasybuilders:developfrom
boegel:robust_unit_tests
Feb 24, 2015
Merged

make unit tests more robust (REVIEW)#1167
boegel merged 31 commits intoeasybuilders:developfrom
boegel:robust_unit_tests

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Feb 11, 2015

things to fix:

  • make sure the test suite totally ignores the user's EasyBuild configuration: unset any $EASYBUILD_ environment variables
    • example: the unit test suite now goes down hard if a different module naming scheme is used
  • skip tests that require external dependencies, if those deps are not available
  • skip tests that have to be run online, if the tests are being run offline
  • skip tests that require a GitHub token, if no token is available (for the easybuild_test 'user')
  • make sure the framework unit tests can run without having easybuild-easyblocks or easybuild-easyconfigs around
  • make sure no sources are being downloaded by the unit tests

@boegel boegel mentioned this pull request Feb 11, 2015
27 tasks
@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1298/
Test FAILed.

@geimer
Copy link
Copy Markdown
Contributor

geimer commented Feb 11, 2015

As requested by @boegel, here is the output of two failing tests when buildpath is set in the config.cfg file:

FAIL: test_default_config (test.framework.config.EasyBuildConfigTest)
Test default configuration.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/framework/config.py", line 99, in test_default_config
    self.assertEqual(config_options['buildpath'], os.path.join(eb_homedir, 'build'))
AssertionError: '/tmp/eb' != '/home/geimer/.local/easybuild/build'

======================================================================
FAIL: test_generaloption_config (test.framework.config.EasyBuildConfigTest)
Test new-style configuration (based on generaloption).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/framework/config.py", line 145, in test_generaloption_config
    self.assertEqual(build_path(), os.path.join(prefix, 'build'))
AssertionError: '/tmp/eb' != '/tmp/tmpWdtu4H/test1/build'

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1391/
Test FAILed.

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1393/
Test FAILed.

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1394/
Test FAILed.

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1395/
Test FAILed.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Feb 21, 2015

Jenkins: test this please

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1396/
Test PASSed.

@wpoely86
Copy link
Copy Markdown
Member

With new patches: https://gist.github.com/c24222df954cf1d40323

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Feb 21, 2015

@wpoely86: thanks for sharing your test results;

one test is failing because you were using an older version of easybuild-easyconfigs, which doesn't have easyblock = 'ConfigureMake' yet in TEMPLATE.eb; that's something you need to fix

another issue was caused by you having $EASYBUILD_TEST_TMPDIR defined, which is translated to $EASYBUILD_TMPDIR by the tests; this is fixed now, the tests will be immune to this where needed (in test/framework/config.py

I'm not sure what's going wrong with the last one, which seems to be an issue with the default 0022 umask that is being set in test_toy_permissions not being honored...

======================================================================
FAIL: test_toy_permissions (test.framework.toy_build.ToyBuildTest)
Test toy build with custom umask settings.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/framework/toy_build.py", line 448, in test_toy_permissions
    self.assertEqual(perms, correct_perms, msg)
AssertionError: Path /home/ward/tmp/easybuild-framework/tmp/easybuild-Winupc/tmpkJpJ00/modules has 0755 permissions: 0775

What's especially weird here is that the test is complaining about the modules subdirectory, but not about the software subdir, so the latter must have the correct permissions...

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Feb 21, 2015

@wpoely86: I'm also seeing the permission/umask issue on another system I have access to, but I'm unable to reproduce the problem with eb itself:

$ umask
0002
$ eb --umask=022 bzip2-1.0.6.eb --installpath=$HOME/newtestdir -f
...
$ ls -ld newtestdir/*
drwxr-xr-x 4 vsc40023 vsc40023 512 Feb 21 21:24 newtestdir/modules
drwxr-xr-x 3 vsc40023 vsc40023 512 Feb 21 21:24 newtestdir/software

Will look into this further sometime later.

@wpoely86
Copy link
Copy Markdown
Member

Debian 7:

======================================================================
FAIL: test_toy_permissions (test.framework.toy_build.ToyBuildTest)
Test toy build with custom umask settings.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/framework/toy_build.py", line 448, in test_toy_permissions
    self.assertEqual(perms, correct_perms, msg)
AssertionError: Path /home/ward/tmp/easybuild-D6hwzN/tmpxXy3QU/modules has 0755 permissions: 0775

----------------------------------------------------------------------
Ran 231 tests in 1245.473s

FAILED (failures=1)
ERROR: Not all tests were successful.

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1405/
Test PASSed.

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1407/
Test PASSed.

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1408/
Test PASSed.

@wpoely86
Copy link
Copy Markdown
Member

Okay, it now fully works!

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1409/
Test PASSed.

Comment thread test/framework/utilities.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if you do a and not key.startswith(test_env_var_prefix) you don't need teh eb_test_env_vars nor the last for loop

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok, good suggestion

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

on second thought, no, that won't work, since I'm redefining $EASYBUILD_TEST_FOO as $EASYBUILD_FOO, the $EASYBUILD_TEST_FOO shouldn't stay around, it should be undefined to make sure the tests are isolated from any haphazard config settings

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1411/
Test PASSed.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Feb 24, 2015

Jenkins: test this please

@hpcugentbot
Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1416/
Test PASSed.

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Feb 24, 2015

This should be good to go in now, and fixing the minor remarks @stdweird had.

Thanks a lot for the feedback, @wpoely86 and @stdweird, the unit tests should be a lot more robust now, which is a nice change to go along with EasyBuild v2.0.

Going in!

boegel added a commit that referenced this pull request Feb 24, 2015
make unit tests more robust (REVIEW)
@boegel boegel merged commit f2d7b3f into easybuilders:develop Feb 24, 2015
@boegel boegel deleted the robust_unit_tests branch February 24, 2015 16:06
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.

5 participants