summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/provider/vcsrepo/git_spec.rb
AgeCommit message (Collapse)Author
2015-12-22Add mirror option for git cloningStrech (Sergey Fedorov)
Example: vcsrepo { '/path/to/repo': ensure => mirror, provider => git, source => 'git://example.com/repo.git', }
2015-08-14MODULES-2125 - Allow revision to be passed without sourceMorgan Haskel
Will also work with empty repositories.
2015-06-22Merge pull request #255 from jonnytpuppet/depth_fixDavid Schmitt
MODULES-2131 Git provider now takes account of revision property when using depth property.
2015-06-22MODULES-2131 Git provider now takes account of revision property when using ↵Jonathan Tripathy
depth property.
2015-03-25Fix remote hash ordering for unit testsColleen Murphy
Without this commit, the unit tests for the git provider changing multiple remotes mocks the remotes in a particular order. While in practice it doesn't matter which remote the update_remotes method updates first, the unit tests must be able to mock them in the correct order. For ruby 1.8.7, a Hash will not necessarily produce key value pairs in the same order on each run, which causes intermittent failures in the unit tests. This change sorts the :source property values before trying to update them, and updates the unit tests to expect the values in alphabetical order.
2015-01-21Implemented multiple remotes feature for git provider.Jonathan Tripathy
2015-01-13removing private teststphoney
removing private tests, due to rspec3 not handling private methods
2014-12-26MODULES-1596 - Repository repeatedly destroyed/created with forceMorgan Haskel
The `retrieve` method was calling `create` and `destroy` on every run with `force => true`. Retrieve should not be making any changes to the system, so removed that code, and updated `working_copy_exists` to make sure that the directory not only contains a `.git` directory, but also if `source` is specified it also matches `#{path}/.git/config` so that it will overwrite a git repo with a different source. Updated tests to not check for the old broken behavior. Added a regression test.
2014-09-29Convert specs to RSpec 2.99.2 syntax with TranspecIgor Galić
This conversion is done by Transpec 2.3.7 with the following command: transpec * 22 conversions from: it { should ... } to: it { is_expected.to ... } * 19 conversions from: obj.should to: expect(obj).to * 15 conversions from: == expected to: eq(expected) * 5 conversions from: it { should_not ... } to: it { is_expected.not_to ... } * 2 conversions from: its(:attr) { } to: describe '#attr' do subject { super().attr }; it { } end * 2 conversions from: obj.should_not to: expect(obj).not_to * 2 conversions from: proc { }.should to: expect { }.to * 1 conversion from: be_false to: be_falsey * 1 conversion from: be_true to: be_truthy For more details: https://github.com/yujinakayama/transpec#supported-conversions
2014-07-11(MODULES-660) Correct detached HEAD on latestHunter Haugen
Previously vcsrepo detached HEAD on checkout which caused further branch revisions to fail. This corrects the behavior, and works on git 1.7, 1.8, 1.9, and 2.0
2014-06-26Update noop to workHunter Haugen
2014-05-21Update specs and fix FM-1361Hunter Haugen
- Add install.rb for pre-suite - Add catches for failures/changes to manifest application - Correct root ssh key copying - Add sleeps for killing processes releasing ports - Fix FM-1361
2014-05-16Added multiline parsing tests for branch -aTravis Fields
2014-05-15Fix spec testsTravis Fields
2014-05-15Fix detached head stateTravis Fields
2014-05-13Fix issue where force=>true was not destroying repository then recreatingTravis Fields
2014-04-03fix tabbing in vcsrepo testIgor Galić
2014-01-11git: actually use the remote parameterMiguel Di Ciurcio Filho
When using the following sample, the provider does not use the value of remote when cloning a repository: vcsrepo {'/path/to/repo': ensure => 'present', provider => 'git', remote => 'test', source => 'git@somerepo:repo.git', } $ git remote origin This commit makes sure that the new repository has a remote with the supplied value. Closes #MODULES-430
2014-01-07Add the option to shallow clones with gitFelipe Reyes
The new parameter used to indicate that you want a shallow clone is `:depth`
2013-12-04Stripping git on_branch? return value; contains trailing newlineMike Gerwitz
This commit also contains git provider `latest' method formatting changes; squashed by request.
2013-12-02Using rev-parse to determine branch name of HEAD for on_branch? methodMike Gerwitz
2013-09-18Add convert_working_copy_to_bear and convert_bare_to_working_copy tests.Ashley Penney
2013-09-18Add tests for convert_working_copy_to_bare andAshley Penney
convert_bare_to_working_copy
2013-09-18Add latest tests.Ashley Penney
2013-09-18Add test for latest?Ashley Penney
Also add some fixtures for previous tests.
2013-09-18Overhaul the spec tests to work in rspec2.Ashley Penney
This work gets rid of the provider_example_group and reworks everything to work properly against rspec2. I don't know if I'd consider the style "better" but it works.
2013-08-28update git provider to handle checking out into an existing (empty) dirJohn Iacona
2013-07-17Merge pull request #46 from Paulche/masterAaron Stone
Enable unlimited nesting for submodule updating
2013-07-17fix git provider checkout of a remote ref on an existing repoJoshua Hoblitt
Per discussion of https://github.com/puppetlabs/puppetlabs-vcsrepo/issues/51 in the git channel on freenode, EugeneKay <eugene@kashpureff.org> stated that `git rev-parse` is not capable of inspecting remote refs but that `git ls-remote` is. This patch makes a second attempt to resolve the ref with `ls-remote` if `rev-parse` fails. The git provider also appears to support several type features that are not tagged under `has_features`. It's not clear if this is the best way to resolve this issue or if the provider should be refactored to work with different type features. Demonstration of the problem with changing refs (branches and tags) $ git --version git version 1.7.1 $ cat master.pp branch.pp vcsrepo { '/tmp/vcsrepo': ensure => present, provider => git, source => 'https://github.com/puppetlabs/puppetlabs-vcsrepo.git', revision => 'master', } vcsrepo { '/tmp/vcsrepo': ensure => present, provider => git, source => 'https://github.com/puppetlabs/puppetlabs-vcsrepo.git', revision => 'feature/cvs', } $ puppet apply --modulepath=`pwd`/.. master.pp Notice: /Stage[main]//Vcsrepo[/tmp/vcsrepo]/ensure: Creating repository from present Notice: /Stage[main]//Vcsrepo[/tmp/vcsrepo]/ensure: created Notice: Finished catalog run in 2.19 seconds $ puppet apply --modulepath=`pwd`/.. branch.pp Error: /Stage[main]//Vcsrepo[/tmp/vcsrepo]: Could not evaluate: Execution of '/usr/bin/git rev-parse feature/cvs' returned 128: fatal: ambiguous argument 'feature/cvs': unknown revision or path not in the working tree. Use '--' to separate paths from revisions feature/cvs Notice: Finished catalog run in 1.69 seconds
2013-07-17Unlimited sudmodule's nesting for git providerPaul Chechetin
2013-07-14Fix git tests broken by dcd0d14Aaron Stone
2013-03-06Update origin if necessary before checking revisionRaphaël Pinson
2012-10-19Use symbols consistently with provider.expects()Aaron Stone
2012-10-18Remove excess whitespace.Aaron Stone
2012-10-18Update tests to match current code.Aaron Stone
2012-10-18Get the specs running under bundler.Aaron Stone
2010-03-18Support different create and revision= operations depending on the revision ↵Bruce Williams
type in Git (commit, tag, or local/remote branch)
2010-03-18Add submodule support to git providerBruce Williams
2010-03-18Move support fileBruce Williams
2010-03-18Fix bad context nestingBruce Williams
2010-03-18Rename methods context_with(out)? => context_with\1_resource for clarityBruce Williams
2010-03-18Subversion to use provider example group API for specsBruce Williams
2010-03-17Further condense provider example group API, update Bazaar provider spec to ↵Bruce Williams
use it.
2010-03-17Build ProviderExampleGroup for refactored provider testsBruce Williams
2010-03-15ensure = latest to support reference tracking.\n\nWorking with tags, more ↵Bruce Williams
work needed for branches (at least with git)
2010-03-13Some fixes after live testing, add support for bare cloned reposBruce Williams
2010-03-13Convert bare repos to working copy repos and vice-versaBruce Williams
2010-03-12Tests for Git revision property, cleanupBruce Williams
2010-03-12Basic tests for git provider, stub for svn providerBruce Williams