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
50bcf361
There was a problem fetching the pipeline summary.
Commit
50bcf361
authored
8 years ago
by
Felipe Shi Iu Wu
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#13
: implement initial end-to-end tests
parent
31f73bd2
No related branches found
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
+91
-0
91 additions, 0 deletions
test/returnTest.bats
with
118 additions
and
7 deletions
.gitlab-ci.yml
+
27
−
7
View file @
50bcf361
...
...
@@ -7,27 +7,32 @@ compile:
artifacts
:
paths
:
-
bin/
-
build/
tags
:
-
build
-
regular
-
debian
script
:
-
echo "Estágio 'build'"
-
apt-get update && apt-get install -y build-essential && apt-get install -y cmake
-
apt-get install -y git
-
apt-get update && apt-get install -y build-essential cmake git
-
git submodule init
-
git submodule update --init --recursive
-
mkdir build
-
cd build
-
cmake ..
-
cmake
-DPRINT_JSON=ON
..
-
make
testDebian
:
stage
:
test
tags
:
-
build
-
regular
-
debian
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
:
-
compile
...
...
@@ -35,7 +40,22 @@ testUbuntu:
stage
:
test
tags
:
-
ubuntu
-
regular
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
:
-
compile
This diff is collapsed.
Click to expand it.
test/returnTest.bats
0 → 100755
+
91
−
0
View file @
50bcf361
#!/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" {
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" {
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