Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Automated Unit Testing / Continuous Integration #84

Open
lw-schick opened this issue Dec 7, 2016 · 7 comments
Open

Automated Unit Testing / Continuous Integration #84

lw-schick opened this issue Dec 7, 2016 · 7 comments
Assignees
Milestone

Comments

@lw-schick
Copy link
Collaborator

lw-schick commented Dec 7, 2016

It would be really nice to have automated unit testing.

That could be realised with a gitlab docker image and a continuous integration tool into this repo.

The idea behind that is to avoid bugs like #85

@ngetchell
Copy link
Owner

I like this idea. A lot.

I don't think I'll have issues generating a key on the fly (http://stackoverflow.com/questions/23640961/gitlab-api-how-to-generate-the-private-token). The issue would be finding a service like appveyor that supports docker images. I wouldn't want to restrict PSGitLab development to users who understand docker and I would like to make sure that all commits run against this sort of testing.

@lw-schick
Copy link
Collaborator Author

I recommend using Travis CI. That service allows using docker see here.

I recommend that we first wait until PowerShell 6 is released. It supports also Linux...

@ngetchell
Copy link
Owner

ngetchell commented Mar 4, 2017

I got to use Travis CI lately for some Ansible roles I've built. Pretty slick. I was able to get the latest version of PowerShell installed on Ubuntu Trusty using the following .travis.yml file.

I've been looking into this issue further and currently have a roadblock. GitLab no longer comes configured with a default username and password. I need a way to set credentials on a brand new instance. Once that is done I think I'm close.

@ngetchell
Copy link
Owner

useful snippet

$URI = 'http://10.5.116.121:10080//api/v4/session?login=root&password=Pass1word!'
$Body = @{
    login='root'
    password='Pass1word'
    email='fake@email.com'
}
$Session = Invoke-RestMethod -Uri $URI -Method Post

$Headers = @{
    'PRIVATE-TOKEN'= $($Session.private_token)
}

Invoke-RestMethod -Uri 'http://10.5.116.121:10080/api/v4/projects' -Headers $Headers

@michaeltlombardi
Copy link

Building on GitLab and using GitLab CI also lets you use docker images, fwiw.

@lw-schick lw-schick removed their assignment Apr 25, 2017
@ngetchell ngetchell assigned ngetchell and unassigned ngetchell Oct 27, 2017
@ngetchell ngetchell assigned ngetchell and unassigned ngetchell Feb 28, 2018
@ngetchell
Copy link
Owner

ngetchell commented Mar 18, 2019

@TerrapinStation asked offline if he could contribute to this and I say I'm all for it. Here is my to-do list.

  • Set Access Token to a known value to bypass first-time user prompts.
  • Skip integration tests when running Pester locally ( need to rework the Invoke-Build task )
  • Only run Integration tests in CI env but should support running by hand if the developer wants
  • Successfully run the Get-GitlabUser integration test found here

Please track all work against the travis branch as that is where I'm keeping the work. Until it is ready for production.

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

No branches or pull requests

3 participants