mirror of
https://github.com/saltstack-formulas/packages-formula.git
synced 2025-04-16 09:40:23 +00:00
test(golang): basic integrtaion test & tweaks
This commit is contained in:
parent
284b240c33
commit
6c3de2231d
7 changed files with 55 additions and 11 deletions
|
@ -21,12 +21,16 @@ platforms:
|
|||
run_command: /lib/systemd/systemd
|
||||
provision_command:
|
||||
- apt-get update && apt-get install -y udev locales git
|
||||
- echo 'export PATH=${PATH}:/usr/local/go/bin' >/etc/default/golang.sh
|
||||
- export PATH="${PATH}:/usr/local/go/bin"
|
||||
- name: ubuntu-18.04
|
||||
driver_config:
|
||||
image: ubuntu:18.04
|
||||
run_command: /lib/systemd/systemd
|
||||
provision_command:
|
||||
- apt-get update && apt-get install -y udev locales git
|
||||
- echo 'export PATH=${PATH}:/usr/local/go/bin' >/etc/default/golang.sh
|
||||
- export PATH="${PATH}:/usr/local/go/bin"
|
||||
- name: ubuntu-16.04
|
||||
driver_config:
|
||||
image: ubuntu:16.04
|
||||
|
@ -35,6 +39,8 @@ platforms:
|
|||
- apt-get update && apt-get install -y udev locales git
|
||||
- locale-gen en_US.UTF-8
|
||||
- update-locale LANG=en_US.UTF-8
|
||||
- echo 'export PATH=${PATH}:/usr/local/go/bin' >/etc/default/golang.sh
|
||||
- export PATH="${PATH}:/usr/local/go/bin"
|
||||
- name: centos-7
|
||||
driver_config:
|
||||
image: centos:7
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
{%- for package in packages.golang.clean %}
|
||||
|
||||
packages-golang-clean-cmd-run-go-clean-{{ package }}:
|
||||
packages-golang-clean-{{ package }}-cmd-run:
|
||||
cmd.run:
|
||||
- name: go clean -i {{ package }}...
|
||||
- runas: {{ packages.rootuser }}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
{%- for package in packages.golang.goget %}
|
||||
|
||||
packages-golang-goget-cmd-run-go-get-{{ package }}:
|
||||
packages-golang-goget-{{ package }}-cmd-run:
|
||||
cmd.run:
|
||||
- name: go get {{ package }}
|
||||
- runas: {{ packages.rootuser }}
|
||||
|
|
|
@ -15,7 +15,7 @@ control 'Archive packages' do
|
|||
it { should exist }
|
||||
end
|
||||
end
|
||||
describe file('/usr/local/bin/kubectl') do
|
||||
describe file('/usr/local/go/bin/go') do
|
||||
it { should be_executable }
|
||||
end
|
||||
end
|
||||
|
|
22
test/integration/default/golang_spec.rb
Normal file
22
test/integration/default/golang_spec.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
go_path = '/home/kitchen/go'
|
||||
|
||||
# GO GET
|
||||
control 'go get github.com/golang/example/hello' do
|
||||
title 'should be installed'
|
||||
desc '(only testing in the Debian platform, as these are OS-independent'
|
||||
|
||||
only_if do
|
||||
os.debian?
|
||||
end
|
||||
|
||||
describe file('/usr/local/go/bin/go') do
|
||||
it { should be_executable }
|
||||
end
|
||||
|
||||
%w(
|
||||
github.com/golang/example/hello
|
||||
).each do |f|
|
||||
describe file("#{go_path}/src/#{f}") do
|
||||
it { should exist }
|
||||
end
|
||||
end
|
|
@ -79,14 +79,22 @@ packages:
|
|||
format: raw
|
||||
source: https://raw.githubusercontent.com/openstack/cinder/master/contrib/block-box/docker-compose.yml
|
||||
hashsum: 1751f8e4f6b4cddd8c4843a0f4473274
|
||||
kubectl:
|
||||
dest: /usr/local/bin
|
||||
golang:
|
||||
dest: /usr/local
|
||||
dl:
|
||||
format: bin
|
||||
source: https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/darwin/amd64/kubectl
|
||||
format: tar
|
||||
source: https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz
|
||||
hashsum: 66d83bfb5a9ede000e33c6579a91a29e6b101829ad41fffb5c5bb6c900e109d9
|
||||
unwanted:
|
||||
- /usr/local/boring_archive_software
|
||||
|
||||
remote_pkgs:
|
||||
zoom: 'https://zoom.us/client/latest/zoom_amd64.deb'
|
||||
|
||||
golang:
|
||||
goget:
|
||||
- github.com/golang/example/hello
|
||||
- github.com/golang/example/outyet
|
||||
clean:
|
||||
- github.com/golang/example/hello
|
||||
- github.com/golang/example/outyet
|
||||
|
|
|
@ -81,14 +81,22 @@ packages:
|
|||
format: raw
|
||||
source: https://raw.githubusercontent.com/openstack/cinder/master/contrib/block-box/docker-compose.yml
|
||||
hashsum: 1751f8e4f6b4cddd8c4843a0f4473274
|
||||
kubectl:
|
||||
dest: /usr/local/bin
|
||||
golang:
|
||||
dest: /usr/local
|
||||
dl:
|
||||
format: bin
|
||||
source: https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/darwin/amd64/kubectl
|
||||
format: tar
|
||||
source: https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz
|
||||
hashsum: 66d83bfb5a9ede000e33c6579a91a29e6b101829ad41fffb5c5bb6c900e109d9
|
||||
unwanted:
|
||||
- /usr/local/boring_archive_software
|
||||
|
||||
remote_pkgs:
|
||||
zoom: 'https://zoom.us/client/latest/zoom_amd64.deb'
|
||||
|
||||
golang:
|
||||
goget:
|
||||
- github.com/golang/example/hello
|
||||
- github.com/golang/example/outyet
|
||||
clean:
|
||||
- github.com/golang/example/hello
|
||||
- github.com/golang/example/outyet
|
||||
|
|
Loading…
Add table
Reference in a new issue