Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simmctic
agent
Commits
25ec1587
There was a problem fetching the pipeline summary.
Commit
25ec1587
authored
8 years ago
by
Diego Giovane Pasqualin
Browse files
Options
Downloads
Plain Diff
Merge branch 'issue/13' into 'development'
Issue
#13
: implement initial end-to-end tests See merge request
!12
parents
31f73bd2
be28b077
No related branches found
Branches containing commit
No related tags found
2 merge requests
!51
Merge development to master
,
!12
Issue #13: implement initial end-to-end tests
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+27
-7
27 additions, 7 deletions
.gitlab-ci.yml
test/returnTest.bats
+93
-0
93 additions, 0 deletions
test/returnTest.bats
with
120 additions
and
7 deletions
.gitlab-ci.yml
+
27
−
7
View file @
25ec1587
...
@@ -7,27 +7,32 @@ compile:
...
@@ -7,27 +7,32 @@ compile:
artifacts
:
artifacts
:
paths
:
paths
:
-
bin/
-
bin/
-
build/
tags
:
tags
:
-
build
-
regular
-
debian
-
debian
script
:
script
:
-
echo "Estágio 'build'"
-
echo "Estágio 'build'"
-
apt-get update && apt-get install -y build-essential && apt-get install -y cmake
-
apt-get update && apt-get install -y build-essential cmake git
-
apt-get install -y git
-
git submodule init
-
git submodule init
-
git submodule update --init --recursive
-
git submodule update --init --recursive
-
mkdir build
-
mkdir build
-
cd build
-
cd build
-
cmake ..
-
cmake
-DPRINT_JSON=ON
..
-
make
-
make
testDebian
:
testDebian
:
stage
:
test
stage
:
test
tags
:
tags
:
-
build
-
regular
-
debian
-
debian
script
:
script
:
-
echo "It works debian:8"
-
apt-get update && apt-get install -y git jq
-
git clone https://github.com/sstephenson/bats.git
-
cd bats
-
./install.sh /usr
-
cd ../test
-
./returnTest.bats
dependencies
:
dependencies
:
-
compile
-
compile
...
@@ -35,7 +40,22 @@ testUbuntu:
...
@@ -35,7 +40,22 @@ testUbuntu:
stage
:
test
stage
:
test
tags
:
tags
:
-
ubuntu
-
ubuntu
-
regular
script
:
script
:
-
echo "It works Ubuntu:16.04"
-
apt-get update && apt-get install -y bats jq
-
cd test
-
./returnTest.bats
dependencies
:
-
compile
testOpensuse
:
stage
:
test
tags
:
-
opensuse
script
:
-
zypper -n update
-
zypper -n install bats && zypper -n install jq
-
cd test
-
./returnTest.bats
dependencies
:
dependencies
:
-
compile
-
compile
This diff is collapsed.
Click to expand it.
test/returnTest.bats
0 → 100755
+
93
−
0
View file @
25ec1587
#!/usr/bin/env bats
function amount_users() {
obj=$(cat export.json | jq -r '.data.amount_users')
[[ "$obj" -eq "$obj" ]] && [[ "$obj" != "null" ]]
}
function mac_address() {
obj=$(cat export.json | jq -r '.data.mac_address')
[[ "$obj" =~ ^(..:){5}..$ ]] && [[ "$obj" != "null" ]]
}
function machine_type() {
obj=$(cat export.json | jq -r '.data.machine_type')
[[ "$obj" != "null" ]]
}
function memory() {
obj=$(cat export.json | jq -r '.data.memory')
[[ "$obj" -eq "$obj" ]] && [[ "$obj" != "null" ]]
}
function os_distro() {
obj=$(cat export.json | jq -r '.data.os_distro')
[[ "$obj" != "null" ]]
}
function os_kernel() {
obj=$(cat export.json | jq -r '.data.os_kernel')
[[ "$obj" != "null" ]]
}
function os_type() {
obj=$(cat export.json | jq -r '.data.os_type')
[[ "$obj" != "null" ]]
}
function processor() {
obj=$(cat export.json | jq -r '.data.processor')
[[ "$obj" != "null" ]]
}
setup() {
./../bin/agent-v0.0 | head -n -2 > export.json
[ -s export.json ]
cat export.json
}
teardown() {
rm -f export.json
}
@test "Amount Users" {
run amount_users
[ "$status" -eq 0 ]
}
@test "MAC" {
run mac_address
[ "$status" -eq 0 ]
}
@test "Machine Type" {
run machine_type
[ "$status" -eq 0 ]
}
@test "Memory" {
skip
run memory
[ "$status" -eq 0 ]
}
@test "OS Distro" {
run os_distro
[ "$status" -eq 0 ]
}
@test "OS Kernel" {
run os_kernel
[ "$status" -eq 0 ]
}
@test "OS Type" {
run os_type
[ "$status" -eq 0 ]
}
@test "Processor" {
skip
run processor
[ "$status" -eq 0 ]
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment