Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Paving the way to a more resilient test suite #132

merged 3 commits into from Dec 14, 2012


None yet
4 participants

vmg commented Dec 13, 2012

Here's what I have so far:

  • I've ported the suite to MiniTest::Unit because it looks more like a C framework, and I hate magic blocks and shit
  • I've made repository initialization/teardown as two optional modules that can be included in a suite RepositoryAccess and TempRepositoryAccess.
  • I've killed all the tests that were flaky (i.e. the ones using rm_loose and manually removing references by hand). Any tests that write to the ODB now get their own temporary repository that gets deleted after the test runs.

/cc @brianmario @ymendel @scottjg


brianmario commented Dec 13, 2012


While I don't mind the block syntax (I mean, I do prefer rspec afterall :trollface:), I do also enjoy a more "raw" feeling test suite for libraries that live close to C like this.


arthurschreiber commented Dec 13, 2012

I actually also prefer rspec over MiniTest::Unit (and especially over MiniTest::Spec or whatever that abomination is called).

Anyway, this is a lot nicer than what we had before. I especially hated the backtraces that MiniTest::Spec generated.


ymendel commented Dec 14, 2012

On a more superficial level, I prefer rspec/minispec/&c things with context 'Blob writing' do and test 'handles new data' do to def test_write_new_blob_data. More than that, I care about things being sensible and internally consistent, and I work with whatever toolset is part of the project. And even more than that, I care about the test suite being robust and helpful.

So overall, 👍.

cc @rick

What's up with that Ångström test, though?


vmg commented Dec 14, 2012

What's up with that Ångström" test, though?

What's up with it? Why do we write the ref by hand instead of just keeping it as a fixture? Because different filesystems have different ways of storing those UTF8 chars -- it's for consistency.


ymendel commented Dec 14, 2012

Sorry, I meant "why is it failing?"


arthurschreiber commented Dec 14, 2012

Because Mac OS X and Linux (Windows too?) are using different character combinations to represent the same unicode characters. If you're then doing e.g. a branch name comparison, depending on the way the name is stored in the source file and your OS, you'll see that test failure.


vmg commented Dec 14, 2012

Alrighty, fixed the test. Merging this toy now.

@vmg vmg added a commit that referenced this pull request Dec 14, 2012

@vmg vmg Merge pull request #132 from libgit2/resilent-tests
Paving the way to a more resilient test suite

@vmg vmg merged commit cbf349d into development Dec 14, 2012

1 check failed

default The Travis build failed

ymendel commented Dec 14, 2012

I still see a red dot for that test-fix commit (1453962), though. Looks like it's okay on 1.9, but bad on 1.8.7.


vmg commented Dec 14, 2012

Travis has been down the whole day. The commit is clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment