fix errors in the test suite during build time
AbandonedPublic

Authored by kparal on May 12 2014, 4:11 PM.

Details

Reviewers
tflink
Maniphest Tasks
T163: Fix %check in libtaskotron
Summary

3 commits:

config: create necessary dirs even when running tests

When running the test suite on a completely clean machine during build
time, our dirs don't exist and we need to create them manually. This
removes the check that was used to skip creating these dirs when running
the test suite. It also removed config.touch_disk attribute, because its
name is no longer true, and on the few occassions we want to avoid
loading config files, it's easy to compare the config profile just by
its name.

Related to T163.

yumrepoinfo: don't try to load config files under test profile

The assumption that there's always a config file available is not valid
during the build process. Therefore when running the test suite, don't
try to load them - the unit test should provide its own.

Related to T163.

spec: enable %check again

This got disabled by accident.

Test Plan

Tests pass and also mock build seems to pass

Diff Detail

Branch
feature/T163-tests
Lint
No Linters Available
Unit
No Unit Test Coverage

When you asked about whether directories should be created or not, I think I misunderstood what you were asking. Couldn't we short-circuit the runner tests by passing in a value for workdir instead of changing the code to allow for directory creation in the unit tests?

I created D95 and tried to take a different approach.

I can easily pass values to Runner(workdir=), but that solves the problem just for Runner. Soon, we will hit the same issue with some other classes. And we will need to manually configure workdirs in all of them. It would be much better if the tmpdir/logdir/other values were filled in automatically. That's what D95 tries to solve. The directories still get created (because we will need that eventually, at least in functional tests), but they are just temporary directories, we no longer try to use the system-wide ones. Therefore there should be no permission problems.

kparal abandoned this revision.May 14 2014, 1:06 PM

This was obsoleted by D95.