using gitlab-development-kit, spec tests fail - gitlab

The date is/was 12/17/2014, I'm trying to run gitlab-ce tests from within gitlab-development-kit. I'm hoping someone familiar with gitlab-ce development can help here. I want to have the tests pass before I begin development. I'm not sure if this warrants a bug report, it may be my environment (CentOS 6.5, rvm 1.26.3, ruby 2.1.3p242 )
I followed instructions on gitlab-development-kit to clone it, run make (to download latest gitlab + gitlab-shell).
I run bundle exec foreman start, redis and pgsql start.
Every thing is looking good, I ran gitlab and it worked fine in development env. I reset everything by recloning and following steps and then tested.
Within ./gitlab, I run "rake gitlab:test"; lots of passed, green tests.
Until I the end, I receive this:
...(many, and all, passing tests above here)...
Scenario: Navigate to project feed
✔ Given I sign in as a user # features/steps/shared/authentication.rb:7
✔ And I own a project # features/steps/shared/project.rb:5
✔ And I visit my project's home page # features/steps/shared/paths.rb:169
✔ Given I visit my project's files page # features/steps/shared/paths.rb:177
✔ Given I press "g" and "p" # features/steps/shared/shortcuts.rb:4
✔ Then the active main tab should be Home # features/steps/shared/project_tab.rb:7
/usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/partial_renderer.rb:436:in `partial_path': 'nil' is not an ActiveModel-compatible object. It must implement :to_partial_path. (ActionView::Template::Error)
from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/partial_renderer.rb:345:in `setup'
from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/partial_renderer.rb:262:in `render'
from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/renderer.rb:47:in `render_partial'
from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/helpers/rendering_helper.rb:35:in `render'
from /usr/local/rvm/gems/ruby-2.1.3/gems/haml-4.0.5/lib/haml/helpers/action_view_mods.rb:10:in `block in render_with_haml'
from /usr/local/rvm/gems/ruby-2.1.3/gems/haml-4.0.5/lib/haml/helpers.rb:89:in `non_haml'
from /usr/local/rvm/gems/ruby-2.1.3/gems/haml-4.0.5/lib/haml/helpers/action_view_mods.rb:10:in `render_with_haml'
from /home/git/gitlab-development-kit/gitlab/app/views/projects/blob/_blob.html.haml:20:in `_app_views_projects_blob__blob_html_haml__1171767312904667641_107433960'
from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/template.rb:145:in `block in render'
from /usr/local/rvm/gems/ruby-2.1.3/gems/activesupport-4.1.1/lib/active_support/notifications.rb:161:in `instrument'
from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/template.rb:339:in `instrument'
from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/template.rb:143:in `render'
from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
...
When I inspect app/views/projects/blob/_blob.html.haml:20
I can see
%ul.blob-commit-info.bs-callout.bs-callout-info.hidden-xs
- blob_commit = #repository.last_commit_for_path(#commit.id, #blob.path)
= render blob_commit, project: #project
The error is complaining because blob_commit is nil, from the line
#repository.last_commit_for_path(#commit.id, #blob.path)
This is a pure clone of everything, I haven't began to make modifications yet. I waited a day to see if maybe the next update would fix things but it hasn't. I don't want to start a feature branch if I'm already having failing tests.

I found out the answer to my problem.
CentOS 6.5 hasn't upgraded their git rpm to anything beyond 1.7.1
I added some debugging to app/models/repository.rb, in def commit(id = HEAD), and def last_commit_for_path(sha, path)
It appears that in last_commit_for_path, on gitlab-test_bare, the following command is run:
git rev-list --max-count 1 5937ac0a7beb003549fc5fd26fc247adbce4a52e -- CHANGELOG
which results in an exception
fatal: bad revision '1'
which results in '#'repository.last_commit line above to assign nil to blob_commit.
It looks like --max-count 1, in my environment, must be --max-count=1.
git rev-list --max-count=1 5937ac0a7beb003549fc5fd26fc247adbce4a52e -- CHANGELOG
which results in a valid commit sha
913c66a37b4a45b9769037c55c2d238bd0942d2e
When I looked at my git version, i noticed it was extremely out of date (1.7 vs 2.2) so I updated using source and the tests pass since gitlab can execute the --max-count 1 as a parameter to git.

Related

GitLab CI/CD pull code from repository before building ASP.NET Core

I have GitLab running on computer A, development environment (Visual studio Pro) on computer B and Windows Server on computer C.
I set up GitLab-Runner on computer C (Windows server). I also set up .gitlab-ci.yml file to perform build and run tests for ASP.NET Core application on every commit.
I don't know how can I get code on computer C (Windows server) so I can build it (dotnet msbuild /p:Configuration=Release "%SOLUTION%"). It bothers me that not a single example .gitlab-ci.yml I found on net, doesn't pull code form GitLab, before building application. Why?
Is this correct way to set-up CI/CD:
User create pull request (a new branch is created)
User writes code
User commit code to branch from computer B.
GitLab runner is started on computer C.
It needs to pull code from current branch (CI_COMMIT_REF_NAME)
Build, test, deploy ...
Should I use common git command to get the code, or is this something GitLab runner already do? Where is the code?
Why no-one pull code from GitLab in .gitlab-ci.yml?
Edited:
I get error
'"git"' is not recognized as an internal or external command
. Solution in my case was restart GitLab-Runner. Source.
#MilanVidakovic explain that source is automatically downloaded (which I didn't know).
I just have one remaining problem of how to get correct path to my .sln file.
Here is my complete .gitlab-ci.yml file:
variables:
SOLUTION: missing_path_to_solution #TODO
before_script:
- dotnet restore
stages:
- build
build:
stage: build
script:
- echo "Building %CI_COMMIT_REF_NAME% branch."
- dotnet msbuild /p:Configuration=Release "%SOLUTION%"
except:
- tags
I need to set correct variable for SOLUTION. My dir (where GitLab-Runner is located) currently holds this folder/files:
- config.toml
- gitlab-runner.exe
- builds/
- 7cab42e4/
- 0/
- web/ # I think this is project group in GitLab
- test/ # I think this is project name in GitLab
- .sln
- AND ALL OTHER PROJECT FILES #Based on first look
- testm.tmp
So, what are 7cab42e4, 0. Or better how to get correct path to my project structure? Is there any predefined variable?
Edited2:
Answer is CI_PROJECT_DIR.
I'm not sure I follow completely.
On every commit, Gitlab runner is fetching your repository to C:\gitlab-runner\builds.. on the local machine (Computer C), and builds/deploys or does whatever you've provided as an action for the stage.
Also, I don't see the need for building the source code again. If you're using Computer C for both runner and tests/acceptance, just let the runner do the building and add Artifacts item in your .gitlab-ci.yaml. Path defined in artifacts will retain your executables on Computer C, which you are then able to use for whatever purposes.
Hope it helps.
Edit after comment:
When you push to repository, Gitlab CI/CD automatically checks your root folder for .gitlab-ci.yaml file. If its there, the runner takes over, parses the file and starts executing jobs/stages.
As soon as the file itself is valid and contains proper jobs and stages, runner fetches the latest commit (automatically) and does whatever script item tells it to do.
To verify that everything works correctly, go to your Gitlab -> CI / CD -> Pipelines, and check out whats going on. You should see something like this:
Maybe it would be best if you posted your .yaml file, there could be a number of reasons your runner is not picking up the code. For instance, maybe your .yaml tags are not matching what runner is created to pick up etc.

Environemnt variables changes are not reflecting while using gitlab-ci

I'm using gitlab-ci & my .gitlab-ci.yml looks like
variables:
DASHBOARD_RESET_ROUTE: '/#/reset-password'
DEFAULT_LOCATION_TYPE: 'P'
This was deployed successfully but when I changed the value of DEFAULT_LOCATION_TYPE to some other text.
The console logs are still showing the old values
Then, even after removing the whole variable from both .yml file & gitlab.com secret variables. The console.logs still print the old values.
Output at gitlab.com UI is:
Running with gitlab-runner 10.1.0 (c1ebf97h)
on Test - ip-172-31-12-234 (6d0vb950)
Using Shell executor...
Running on ip-XXX-XX-XX-XXX...
Fetching changes...
Removing node_modules/
HEAD is now at fff6491 wip
Checking out fff64913 as feat/ci-cd...
Skipping Git submodules setup
Checking cache for default...
Successfully extracted cache
$ npm install
Thanks In Advance
Okay, So reason was using shell as an executor, That was the reason the environment variables are not reloaded again.
Then I reconfigured with docker as an executor & it's working fine.

gcloud app deploy does not remove previous versions

I am running a Node.js app on Google App Engine, using the following command to deploy my code:
gcloud app deploy --stop-previous-version
My desired behavior is for all instances running previous versions to be terminated, but they always seem to stick around. Is there something I'm missing?
I realize they are not receiving traffic, but I am still paying for them and they cause some background telemetry noise. Is there a better way of running this command?
Example output of the gcloud app instances list:
As you can see I have two different versions running.
We accidentally blew through our free Google App Engine credit in less than 30 days because of an errant flexible instance that wasn't cleared by subsequent deployments. When we pinpointed it as the cause it had scaled up to four simultaneous instances that were basically idling away.
tl;dr: Use the --version flag when deploying to specify a version name. An existing instance with the same version will be
replaced then next time you deploy.
That led me down the rabbit hole that is --stop-previous-version. Here's what I've found out so far:
--stop-previous-version doesn't seem to be supported anymore. It's mentioned under Flags on the gcloud app deploy reference page, but if you look at the top of the page where all the flags are listed, it's nowhere to be found.
I tried deploying with that flag set to see what would happen but it seemingly had no effect. A new version was still created, and I still had to go in and manually delete the old instance.
There's an open Github issue on the gcloud-maven-plugin repo that specifically calls this out as an issue with that plugin but the issue has been seemingly ignored.
At this point our best bet at this point is to add --version=staging or whatever to gcloud deploy app. The reference docs for that flag seem to indicate that that it'll replace an existing instance that shares that "version":
--version=VERSION, -v VERSION
The version of the app that will be created or replaced by this deployment. If you do not specify a version, one will be generated for you.
(emphasis mine)
Additionally, Google's own reference documentation on app.yaml (the link's for the Python docs but it's still relevant) specifically calls out the --version flag as the "preferred" way to specify a version when deploying:
The recommended approach is to remove the version element from your app.yaml file and instead, use a command-line flag to specify your version ID
As far as I can tell, for Standard Environment with automatic scaling at least, it is normal for old versions to remain "serving", though they should hopefully have zero instances (even if your scaling configuration specifies a nonzero minimum). At least that's what I've seen. I think (I hope) that those old "serving" instances won't result in any charges, since billing is per instance.
I know most of the above answers are for Flexible Environment, but I thought I'd include this here for people who are wondering.
(And it would be great if someone from Google could confirm.)
I had same problem as OP. Using the flex environment (some of this also applies to standard environment) with Docker (runtime: custom in app.yaml) I've finally solved this! I tried a lot of things and I'm not sure which one fixed it (or whether it was a combination) so I'll list the things I did here, the most likely solutions being listed first.
SOLUTION 1) Ensure that cloud storage deletes old versions
What does cloud storage have to do with anything? (I hear you ask)
Well there's a little tooltip (Google Cloud Platform Web UI (GCP) > App Engine > Versions > Size) that when you hover over it says:
(Google App Engine) Flexible environment code is stored and billed from Google Cloud Storage ... yada yada yada
So based on this info and this answer I visited GCP > Cloud Storage > Browser and found my storage bucket AND a load of other storage buckets I didn't know existed. It turns out that some of the buckets store cached cloud functions code, some store cached docker images and some store other cached code/stuff (you can tell which is which by browsing the buckets).
So I added a deletion policy to all the buckets (except the cloud functions bucket) as follows:
Go to GCP > Cloud Storage > Browser and click the link (for the relevant bucket) in the Lifecycle Rules column > Click ADD A RULE > THEN:
For SELECT ACTION choose "Delete Object" and click continue
For SELECT OBJECT choose "Number of newer versions" and enter 1 in the input
Click CREATE
This will return you to the table view and you should now see the rule in the lifecycle rules column.
REPEAT this process for all relevant buckets (the relevant buckets were described earlier).
THEN delete the contents of the relevant buckets. WARNING: Some buckets warn you NOT to delete the bucket itself, only the contents!
Now re-deploy and your latest version should now get deployed and hopefully you will never have this problem again!
SOLUTION 2) Use deploy flags
I added these flags
gcloud app deploy --quiet --promote --stop-previous-version
This probably doesn't help since these flags seem to be the default but worth adding just in case.
Note that for the standard environment only (I heard on the grapevine) you can also use the --no-cache flag which might help but with flex, this flag caused the deployment to fail (when I tried).
SOLUTION 3)
This probably does not help at all, but I added:
COPY app.yaml .
to the Dockerfile
TIP 1)
This is probably more of a helpful / useful debug approach than a fix.
Visit GCP > App Engine > Versions
This shows all versions of your app (1 per deployment) and it also shows which version each instance is running (instances are configured in app.yaml).
Make sure all instances are running the latest version. This should happen by default. Probably worth deleting old versions.
You can determine your version from the gcloud app deploy logs (at the start of the logs) but it seems that the versions are listed by order of deployment anyway (most recent at top).
TIP 2)
Visit GCP > App Engine > Instances
SSH into an instance. This is just a matter of clicking a few buttons (see screenshot below). Once you have SSH'd in run:
docker exec -it gaeapp /bin/bash
Which will get you into the docker container running your code. Now you can browse around to make sure it has your latest code.
Well I think my answer is long enough now. If this helps, don't thank me, J-ES-US is the one you should thank ;) I belong to Him ^^
Google may have updated their documentation cited in #IAmKale's answer
Note that if the version is running on an instance of an auto-scaled service, using --stop-previous-version will not work and the previous version will continue to run because auto-scaled service instances are always running.
Seems like that flag only works with manually scaled services.
This is a supplementary and optional answer in addition to my other main answer.
I am now, in addition to my other answer, auto incrementing version manually on deploy using a script.
My script contents are below.
Basically, the script auto increments version every time you deploy. I am using node.js so the script uses npm version to bump the version but this line could easily be tweaked to whatever language you use.
The script requires a clean git working directory for deployment.
The script assumes that when the version is bumped, this will result in file changes (e.g. changes to package.json version) that need pushing.
The script essentially tries to find your SSH key and if it finds it then it starts an SSH agent and uses your SSH key to git commit and git push the file changes. Else it just does a git commit without a push.
It then does a deploy using the --version flag ... --version="${deployVer}"
Thought this might help someone, especially since the top answer talks a lot about using the --version flag on a deploy.
#!/usr/bin/env bash
projectName="vehicle-damage-inspector-app-engine"
# Find SSH key
sshFile1=~/.ssh/id_ed25519
sshFile2=~/Desktop/.ssh/id_ed25519
sshFile3=~/.ssh/id_rsa
sshFile4=~/Desktop/.ssh/id_rsa
if [ -f "${sshFile1}" ]; then
sshFile="${sshFile1}"
elif [ -f "${sshFile2}" ]; then
sshFile="${sshFile2}"
elif [ -f "${sshFile3}" ]; then
sshFile="${sshFile3}"
elif [ -f "${sshFile4}" ]; then
sshFile="${sshFile4}"
fi
# If SSH key found then fire up SSH agent
if [ -n "${sshFile}" ]; then
pub=$(cat "${sshFile}.pub")
for i in ${pub}; do email="${i}"; done
name="Auto Deploy ${projectName}"
git config --global user.email "${email}"
git config --global user.name "${name}"
echo "Git SSH key = ${sshFile}"
echo "Git email = ${email}"
echo "Git name = ${name}"
eval "$(ssh-agent -s)"
ssh-add "${sshFile}" &>/dev/null
sshKeyAdded=true
fi
# Bump version and git commit (and git push if SSH key added) and deploy
if [ -z "$(git status --porcelain)" ]; then
echo "Working directory clean"
echo "Bumping patch version"
ver=$(npm version patch --no-git-tag-version)
git add -A
git commit -m "${projectName} version ${ver}"
if [ -n "${sshKeyAdded}" ]; then
echo ">>>>> Bumped patch version to ${ver} with git commit and git push"
git push
else
echo ">>>>> Bumped patch version to ${ver} with git commit only, please git push manually"
fi
deployVer="${ver//"."/"-"}"
gcloud app deploy --quiet --promote --stop-previous-version --version="${deployVer}"
else
echo "Working directory unclean, please commit changes"
fi
For node.js users if you call the script deploy.sh you should add:
"deploy": "sh deploy.sh"
In your package.json scripts and deploy with npm run deploy

How to create a GitLab merge request via command line

We are working on integrating GitLab (enterprise edition) in our tooling, but one thing that is still on our wishlist is to create a merge request in GitLab via a command line (or batchfile or similar, for that matter). We would like to integrate this in our tooling. Searching here and on the web lead me to believe that this is not possible with native GitLab, but that we need additional tooling for that.
Am I correct? And what kind of tooling would I want to use for this?
As of GitLab 11.10, if you're using git 2.10 or newer, you can automatically create a merge request from the command line like this:
git push -o merge_request.create
More information can be found in the docs.
It's not natively supported, but it's not hard to throw together. The gitlab API has support for opening MR: https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/merge_requests.md#create-mr
You can use following utility.
Disclosure : I developed it.
https://github.com/vishwanatharondekar/gitlab-cli
You can create merge request using this.
Some of the features it has are.
Base branch is optional. If base branch is not provided. Current branch is used as base branch.
target branch is optional. If target branch is not provided, default branch of the repo in gitlab will be used.
Created pull request page will be opened automatically after successful creation.
If title is not supported with -m option value. It will be taken from in place editor opened. First line is taken as title.
In the editor opened third line onwards takes as description.
Comma separated list of labels can be provided with its option.
Supports CI.
Repository specific configs can be given.
squash option is available.
remove source branch option is available.
If you push your branch before this command (git push -o merge_request.create) it will not work. Git will response with Everything up-to-date and merge request will not be created (gitlab 12.3).
When I tried to remove my branch from a server (do not remove your local branch!!!) then it worked for me in this form.
git push --set-upstream origin your-branch-name -o merge_request.create
In addition to answering of #AhmadSherif, You can use merge_request.target=<branch_name> for declaring the target branch.
sample usage:
git push -o merge_request.create -o merge_request.target=develop origin feature
Simple This:
According to the Gitlab documents, you can define an alias for this command to simpler usage.
git config --global alias.mwps "push -o merge_request.create -o
merge_request.target=master -o merge_request.merge_when_pipeline_succeeds"
I made a shell function which opens up the GitLab MR web page with desired parameters.
Based on the directory with the git repo you are currently in, it:
Finds the correct URL to your repo.
Sets the source branch to the branch you're currently on.
As a optional first argument you can provide the target branch. Otherwise, GitLab defaults to your default branch, which is typically master.
gmr() {
# A quick way to open a GitLab merge request URL for the current git branch
# you're on. The optional first argument is the target branch.
repo_path=$(git remote get-url origin --push | sed 's/^.*://g' | sed 's/.git$//g')
current_branch=$(git rev-parse --abbrev-ref HEAD)
if [[ -n $1 ]]; then
target_branch="&merge_request[target_branch]=$1"
else
target_branch=""
fi
xdg-open "https://gitlab.com/$repo_path/merge_requests/new?merge_request[source_branch]=$current_branch$target_branch"
}
You can set more default values in the URL, like removing the source branch after merge:
&merge_request[force_remove_source_branch]=true
Or assignee to someone:
&merge_request[assignee_ids][]=12345
Or add a reviewer:
&merge_request[reviewer_ids][]=54321
You can easily find the possible query string parameters by searching the source of the GitLab MR webpage for merge_request[.
As of now, GitLab sadly does not support this, however I recently saw it on their issue tracker. It appears one can expect a 'native tool' in the upcoming months.
GitLab tweeted out about numa08/git-gitlab some time ago, so I guess this would be worth a try.
In our build script we just pop up the browser with the correct URL and let the developer write his comments in the form hit save to create the merge request. You get this url with the correct parameters by creating a merge request manually and copying the url of the form.
#!/bin/bash
set -e
set -o pipefail
BRANCH=${2}
....
git push -f origin-gitlab $BRANCH
open "https://gitlab.com/**username**/**project-name**/merge_requests/new?merge_request%5Bsource_branch%5D=$BRANCH&merge_request%5Bsource_project_id%5D=99999&merge_request%5Btarget_branch%5D=master&merge_request%5Btarget_project_id%5D=99999"
You can write a local git alias to open a Gitlab Merge Request creation page in the default browser for the currently checked-out branch.
[alias]
lab = "!start https://gitlab.com/path/to/repo/-/merge_requests/new?merge_request%5Bsource_branch%5D=\"$(git rev-parse --abbrev-ref HEAD)\""
(this is a very simple alias for windows; I guess there are equivalent replacements for "start" on linux and fancier aliases that work with github and bitbucket too)
As well as being able to immediately see&modify the details of the MR, the advantage of this over using the merge_request.create push option is that you don't need your local branch to be behind the remote for it to work.
You might additionally want to store the alias in the repo itself.
I use https://github.com/mdsb100/cli-gitlab
I am creating the MR from inside of a gitlab CI docker container based on alpine linux, so I include the install command in before-script (that could also be included in your image). All commands in the following .gitlab-ci.yml file, are also relevant for normal command line usage (as long as you have the cli-gitlab npm installed).
variables:
TARGET_BRANCH: 'live'
GITLAB_URL: 'https://your.gitlab.net'
GITLAB_TOKEN: $PRIVATE_TOKEN #created in user profile & added in project settings
before-script:
-apk update && apk add nodejs && npm install cli-gitlab -g
script:
- gitlab url $GITLAB_URL && gitlab token $GITLAB_TOKEN
- 'echo "gitlab addMergeRequest $CI_PROJECT_ID $CI_COMMIT_REF_NAME \"$TARGET_BRANCH\" 13 `date +%Y%m%d%H%M%S`"'
- 'gitlab addMergeRequest $CI_PROJECT_ID $CI_COMMIT_REF_NAME "$TARGET_BRANCH" 13 `date +%Y%m%d%H%M%S` 2> ./mr.json'
- cat ./mr.json
This will echo true if the merge request already exists, and echo the json result of the new MR if it succeeds to create one (also saving to a mr.json file).
Since GitLab 15.7 (Dec. 2022), the GitLab CLI glab is officially integrated to GitLab.
Introducing the GitLab CLI
The command line is one of the most important tools in a software engineer’s toolkit and the majority of their process and work revolve around tools available there. They customize their CLI with styles and extend it through applications to ensure maximum efficiency while performing tasks. The CLI is the backbone of scripts and workflows developers depend on to complete their work.
To support more developers where they’re already working, we’ve adopted the open source project glab, which will form the foundation of GitLab’s native CLI experience.
The GitLab CLI brings GitLab together with Git and your code, with no application or tab switching required.
You can read about our adoption of glab, our partnership with 1Password, and how to contribute to the project in our blog post.
A special thank you to Clement Sam for creating glab and trusting us with its future.
That means you can create a MR with glab mr create:
glab mr create -a username -t "fix annoying bug"

Puppet + Beaker + Travis: acceptance test failing

I A have a Puppet module with acceptance tests based on Beaker. The module is working fine and when running locally all the acceptance tests run fine. But when I run the tests on Travis I got the following error in the module execution:
/Stage[main]/Alfred::Services/Service[alfred]: Could not evaluate: undefined method `[]' for nil:NilClass
Alfred is a system service based on upstart that is part of my module.
I am using Puppet 4.3.2. Here is the travis build: https://travis-ci.org/nicopaez/alfred-puppet
Any idea?
Looking at the code, there's a few issues.
One is that the environment variable you're using in Travis doesn't set the Puppet version. You need to add that code to your spec_helper_acceptance.rb:
hosts.each do |host|
install_puppet_on(host,
:puppet => ENV['PUPPET_VERSION'] || '4.3.2',
)
end
Right now it's still installing Puppet 3.8 (the default latest)
For further information on what is actually causing the issues in Travis, I forked your repo and did a build where I enabled the debug and trace options for beaker:
result = apply_manifest(pp, :trace => true, :debug => true)
From this, looking at the Travis build, theres an issue with the git clone exec:
Debug: Exec[clone-repo](provider=posix): Executing 'git clone https://github.com/fiuba/alfred.git /var/www/alfred'
Debug: Executing 'git clone https://github.com/fiuba/alfred.git /var/www/alfred'
Notice: /Stage[main]/Alfred::App/Exec[clone-repo]/returns: fatal: Could not change back to '/root': Permission denied
Error: git clone https://github.com/fiuba/alfred.git /var/www/alfred returned 128 instead of one of [0]
You could fix this by using the vcsrepo module, which performs git clones in an more idempotent way:
vcsrepo { '/var/www/alfred':
ensure => present,
source => 'https://github.com/fiuba/alfred.git',
provider => git,
user => 'deployer',
}
There's a few other fixes, I'm PRing some fixes to your module to fix them, and will add a summary here to the Stack Overflow answer after you've reviewed and merged, as some are significant refactors with a few different approaches.

Resources