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

Add functional test for list credential #442

Merged
merged 15 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ references:
python: &PYTHON_IMAGE circleci/python:2.7-stretch
ruby: &RUBY_IMAGE cimg/ruby:2.6.5
ci_machine: &CI_MACHINE_IMAGE ubuntu-1604:202004-01
horus: &HORUS_IMAGE library/docker:dind
ubuntu: &UBUNTU_IMAGE cimg/base:2020.01
centos: &CENTOS_IMAGE viniciusramosdefaria/centos-circleci:7.0
windows: &WINDOWS_IMAGE windows-server-2019
Expand Down Expand Up @@ -57,9 +56,8 @@ executors:
working_directory: /workspace

horus-executor:
docker:
- image: *HORUS_IMAGE
user: root
machine:
image: ubuntu-1604:202004-01

delivery-executor:
docker:
Expand Down Expand Up @@ -108,20 +106,13 @@ jobs:
/go/bin/golangci-lint run --no-config --issues-exit-code=1 --deadline=10m -v
horus:
executor: horus-executor
environment:
<<: *ENVIRONMENT
steps:
- setup_remote_docker
- checkout
- run:
name: Horus Security Analysis
command: |
echo "Starting scan Horus..."
docker run --rm -e HORUS_CLIENT_REPO_URL=$HORUS_CLIENT_REPO_URL \
-e HORUS_CLIENT_REPO_BRANCH=$HORUS_CLIENT_REPO_BRANCH \
-e HORUS_CLIENT_API_ADDR=$HORUS_CLIENT_API_ADDR \
-e HORUS_CLIENT_TOKEN=$HORUS_CLIENT_TOKEN \
-e HORUS_CLIENT_API_USE_HTTPS=$HORUS_CLIENT_API_USE_HTTPS \
-e HORUS_VULNERABILITY_CHECK=$HORUS_VULNERABILITY_CHECK horuszup/horus-client:latest
curl -fsSL https://horus-assets.s3.amazonaws.com/install.sh | bash
horus start -p ./ -i testdata,vendor

unit_test:
executor: ritchie-tests-executor
Expand Down
15 changes: 13 additions & 2 deletions functional/core/core_feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@
"steps":[
{
"key":"",
"value":"list repo",
"value":"list",
"action":"main"
}
],
"result":"commons"
"result":"This command consists of multiple subcommands to interact with ritchie."
},
{
"entry":"List repo",
Expand All @@ -128,6 +128,17 @@
],
"result":"commons"
},
{
"entry":"List credential",
"steps":[
{
"key":"",
"value":"list credential",
"action":"main"
}
],
"result":"You dont have any credential"
},
{
"entry":"Delete repo",
"steps":[
Expand Down
15 changes: 8 additions & 7 deletions functional/core/core_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,21 @@ var _ = Describe("RitCore", func() {
// Entry(scenariosCore[4].Entry, scenariosCore[4]),

Entry(scenariosCore[5].Entry, scenariosCore[5]),
Entry(scenariosCore[6].Entry, scenariosCore[6]),
// Entry(scenariosCore[7].Entry, scenariosCore[7]),

// Entry(scenariosCore[6].Entry, scenariosCore[6]),
Entry(scenariosCore[7].Entry, scenariosCore[7]),
// Entry(scenariosCore[8].Entry, scenariosCore[8]),
Entry(scenariosCore[9].Entry, scenariosCore[9]),
// Entry(scenariosCore[10].Entry, scenariosCore[10]),

Entry(scenariosCore[11].Entry, scenariosCore[11]),
// Entry(scenariosCore[9].Entry, scenariosCore[9]),
Entry(scenariosCore[10].Entry, scenariosCore[10]),
// Entry(scenariosCore[11].Entry, scenariosCore[11]),

Entry(scenariosCore[12].Entry, scenariosCore[12]),
Entry(scenariosCore[13].Entry, scenariosCore[13]),

Entry(scenariosCore[14].Entry, scenariosCore[14]),

Entry(scenariosCore[15].Entry, scenariosCore[15]),
Entry(scenariosCore[16].Entry, scenariosCore[16]),
Entry(scenariosCore[17].Entry, scenariosCore[17]),
Entry(scenariosCore[18].Entry, scenariosCore[18]),
)
})
15 changes: 6 additions & 9 deletions functional/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import (
)

const (
rit = "rit"
rit = "rit"
windows = runtime.GOOS == "windows"
// initCmd = "init"
)

Expand All @@ -49,8 +50,7 @@ type Scenario struct {
func (scenario *Scenario) RunSteps() (string, error) {
fmt.Println("Running: " + scenario.Entry)

os := runtime.GOOS
if os == "windows" && len(scenario.Steps) >= 2 {
if windows && len(scenario.Steps) >= 2 {
ginkgo.Skip("Scenarios with multi steps for windows doesnt work")
return "", nil
} else {
Expand All @@ -61,8 +61,7 @@ func (scenario *Scenario) RunSteps() (string, error) {

func (scenario *Scenario) RunStdin() (string, error) {
fmt.Println("Running STDIN: " + scenario.Entry)
os := runtime.GOOS
if os == "windows" {
if windows {
b2, err := scenario.runStdinForWindows()
return b2.String(), err
} else {
Expand All @@ -73,8 +72,7 @@ func (scenario *Scenario) RunStdin() (string, error) {
}

func RitSingleInit() {
os := runtime.GOOS
if os == "windows" {
if windows {
setUpRitSingleWin()
} else {
setUpRitSingleUnix()
Expand All @@ -83,8 +81,7 @@ func RitSingleInit() {
}

func RitClearConfigs() {
os := runtime.GOOS
if os == "windows" {
if windows {
setUpClearSetupWindows()
} else {
setUpClearSetupUnix()
Expand Down