Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

new feature: ch-test #447

Merged
merged 15 commits into from
Oct 31, 2019
Merged

new feature: ch-test #447

merged 15 commits into from
Oct 31, 2019

Conversation

j-ogas
Copy link
Contributor

@j-ogas j-ogas commented May 15, 2019

Addresses #445.

@j-ogas j-ogas requested review from shanegoff, heasterday and rstyd May 15, 2019 19:47
Copy link
Contributor

@shanegoff shanegoff left a comment

Choose a reason for hiding this comment

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

I think the permissions test should be moved to an option by itself. When I frequently am testing/rebuilding I have to redo the setup for the permissions dirs. Taking those tests out of the run segment would allow the permissions tests to be run separately, so users without root who can't run them anyway don't have to take action to skip them.

@j-ogas j-ogas requested a review from reidpr May 16, 2019 15:12
Copy link
Contributor

@heasterday heasterday left a comment

Choose a reason for hiding this comment

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

Needs a tidy but sounds good to me

Copy link
Collaborator

@reidpr reidpr left a comment

Choose a reason for hiding this comment

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

Nice work. I proposed a revision.

Note you'll need to put it in conf.py as well to create the man page.

As for Shane's comment, I agree that we don't want to require the user to mess around with this. I propose that ch-test create the permissions fixtures if appropriate. I think he's right that it could go in a separate test phase, but I'd prefer to keep the three existing phases for this PR.

doc-src/ch-test.rst Outdated Show resolved Hide resolved
@j-ogas j-ogas requested a review from reidpr July 10, 2019 20:36
@j-ogas
Copy link
Contributor Author

j-ogas commented Jul 10, 2019

Aside from a minor travis fix in run/ch-test.bats to address the the installation case testing, this is ready to be reviewed.

How this will be integrated with travis is not clear. I don't imagine doubling the test time to run the tests via test/Makefile and again via ch-test is an option. Do we then alter travis to run the test suite exclusively through ch-test?

Copy link
Collaborator

@reidpr reidpr left a comment

Choose a reason for hiding this comment

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

Thanks. Various suggestions in-line.

My overall impression was that it seems kind of complicated for what basically is a cd followed by make. However, I became less sure of that as I read on. I do think some of the suggestions could make things simpler.

This will need to be updated to include the builder, which for some has additional configuration (in the case of ch-grow).

Do we then alter travis to run the test suite exclusively through ch-test?

Yes. I'd say this should become the sole supported way to run the tests. That may require updating the docs.

bin/ch-test Outdated Show resolved Hide resolved
bin/ch-test Show resolved Hide resolved
bin/ch-test Outdated Show resolved Hide resolved
bin/ch-test Outdated Show resolved Hide resolved
bin/ch-test Outdated Show resolved Hide resolved
doc-src/ch-test_desc.rst Outdated Show resolved Hide resolved
doc-src/ch-test_desc.rst Outdated Show resolved Hide resolved
doc-src/ch-test_desc.rst Outdated Show resolved Hide resolved
doc-src/conf.py Show resolved Hide resolved
bin/ch-test Outdated Show resolved Hide resolved
@j-ogas
Copy link
Contributor Author

j-ogas commented Sep 11, 2019

Also related to #329.

@j-ogas j-ogas force-pushed the ch-test branch 2 times, most recently from c9ec1cd to b698a4c Compare September 13, 2019 21:46
Copy link
Collaborator

@reidpr reidpr left a comment

Choose a reason for hiding this comment

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

I think overall this looks solid, but I'd like to discuss and walk through it in person. Can we do that next week?

One thing I thought to add: There are currently a few setup/teardown tests, I think mostly to manage the test directories. I think these maybe should be moved to ch-test?

@j-ogas
Copy link
Contributor Author

j-ogas commented Sep 18, 2019

I think overall this looks solid, but I'd like to discuss and walk through it in person. Can we do that next week?

Sounds good.

One thing I thought to add: There are currently a few setup/teardown tests, I think mostly to manage the test directories. I think these maybe should be moved to ch-test?

Agreed.

@reidpr
Copy link
Collaborator

reidpr commented Sep 23, 2019

Add check/workaround for #278?

Comment on lines 68 to 70
:code:`clean`
Delete test artifacts on disk and all images in builder storage (whether
or not Charliecloud-related), except for the permissions test fixtures.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Spicy. Not sure I'd like clean to wipe my docker/buildah image cache. Am I misunderstanding this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Your understanding is correct. Why don't we leave it alone for now (i.e., don't wipe builder storage). I would like an easy way to do that though; our current test/docker-clean.sh isn't very user-facing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I took this out.

Comment on lines 113 to 115
:code:`--pack-dir DIR`
Set packed images directory to :code:`DIR`. Default:
:code:`$CH_TEST_TARDIR` if set, or :code:`/var/tmp/pack`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps we should go ahead and update CH_TEST_TARDIR to CH_TEST_PACKDIR as well? I know it is long, but I'm also wondering if CH_TEST_IMGDIR should be CH_TEST_UNPACKDIR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess the reasoning to leave the variables along is that it's a pretty pervasive change that alters an existing API, so I wanted to leave it alone for now, in case the new vocabulary is not satisfactory.

Copy link
Collaborator

@reidpr reidpr left a comment

Choose a reason for hiding this comment

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

Great work. Some tidy comments. Doesn't pass Travis after my changed; haven't looked into that. Perhaps we can wrap it up today and get it merged?

bin/ch-test Outdated Show resolved Hide resolved
bin/ch-test Outdated Show resolved Hide resolved
bin/ch-test Outdated Show resolved Hide resolved
bin/ch-test Outdated Show resolved Hide resolved
bin/ch-test Outdated Show resolved Hide resolved
test/run/ch-run_misc.bats Outdated Show resolved Hide resolved
test/travis.bash Outdated
cd "$PREFIX/libexec/charliecloud-$version"
ch_test="${PREFIX}/bin/ch-test"
else
ch_test=$(readlink -f bin/ch-test)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the problem readlink solves here?

Copy link
Contributor Author

@j-ogas j-ogas Oct 28, 2019

Choose a reason for hiding this comment

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

Removing the absolute path here will cause travis to error (https://travis-ci.org/hpc/charliecloud/jobs/604006996?utm_medium=notification&utm_source=email).

147 top_dir=$(readlink -f "${ch_bin%/*}")
[...]
173 # Determine source vs prefix installation.
174 if [[ -d "${top_dir}/test" ]]; then
175     # source install
176     testdir=${top_dir}/test
177 else
178     # prefix installation
179     testdir=${top_dir%/charliecloud*}/libexec/charliecloud-$(version 2>&1)/test
180 fi

The check for ${top_dir}/test fails (it shouldn't, it is a source install). I feel like this is because base.sh uses dirname "$0" instead of dirname "${BASH_SOURCE[0]}. When we do ch_test=$(readlink -f bin/ch-test in the travis.bash, the issue is resolved (https://travis-ci.org/hpc/charliecloud/jobs/604009862?utm_medium=notification&utm_source=github_status).

test/travis.bash Show resolved Hide resolved
bin/ch-test Show resolved Hide resolved
bin/ch-test Outdated Show resolved Hide resolved
Copy link
Collaborator

@reidpr reidpr left a comment

Choose a reason for hiding this comment

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

Very nice work. If you are OK with my tidying and it passes tests, then I think this is ready to merge.

bin/ch-test Show resolved Hide resolved
Comment on lines 68 to 70
:code:`clean`
Delete test artifacts on disk and all images in builder storage (whether
or not Charliecloud-related), except for the permissions test fixtures.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I took this out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants