Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d67936b6
Commit
d67936b6
authored
Aug 20, 2018
by
Dan Davison
Committed by
Rémy Coutable
Aug 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add initial smoke tests and documentation
parent
c5bf09e7
Changes
35
Show whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
207 additions
and
100 deletions
+207
-100
doc/development/testing_guide/smoke.md
doc/development/testing_guide/smoke.md
+16
-0
doc/development/testing_guide/testing_levels.md
doc/development/testing_guide/testing_levels.md
+8
-0
qa/README.md
qa/README.md
+6
-6
qa/qa.rb
qa/qa.rb
+4
-2
qa/qa/scenario/taggable.rb
qa/qa/scenario/taggable.rb
+0
-17
qa/qa/scenario/template.rb
qa/qa/scenario/template.rb
+27
-6
qa/qa/scenario/test/instance.rb
qa/qa/scenario/test/instance.rb
+0
-36
qa/qa/scenario/test/instance/all.rb
qa/qa/scenario/test/instance/all.rb
+15
-0
qa/qa/scenario/test/instance/smoke.rb
qa/qa/scenario/test/instance/smoke.rb
+17
-0
qa/qa/specs/features/api/basics_spec.rb
qa/qa/specs/features/api/basics_spec.rb
+1
-1
qa/qa/specs/features/api/users_spec.rb
qa/qa/specs/features/api/users_spec.rb
+1
-1
qa/qa/specs/features/login/basic_spec.rb
qa/qa/specs/features/login/basic_spec.rb
+15
-0
qa/qa/specs/features/login/ldap_spec.rb
qa/qa/specs/features/login/ldap_spec.rb
+1
-1
qa/qa/specs/features/mattermost/group_create_spec.rb
qa/qa/specs/features/mattermost/group_create_spec.rb
+1
-1
qa/qa/specs/features/mattermost/login_spec.rb
qa/qa/specs/features/mattermost/login_spec.rb
+1
-1
qa/qa/specs/features/merge_request/create_spec.rb
qa/qa/specs/features/merge_request/create_spec.rb
+22
-1
qa/qa/specs/features/merge_request/rebase_spec.rb
qa/qa/specs/features/merge_request/rebase_spec.rb
+1
-1
qa/qa/specs/features/merge_request/squash_spec.rb
qa/qa/specs/features/merge_request/squash_spec.rb
+1
-1
qa/qa/specs/features/project/activity_spec.rb
qa/qa/specs/features/project/activity_spec.rb
+1
-1
qa/qa/specs/features/project/add_deploy_key_spec.rb
qa/qa/specs/features/project/add_deploy_key_spec.rb
+1
-1
qa/qa/specs/features/project/add_secret_variable_spec.rb
qa/qa/specs/features/project/add_secret_variable_spec.rb
+1
-1
qa/qa/specs/features/project/auto_devops_spec.rb
qa/qa/specs/features/project/auto_devops_spec.rb
+1
-1
qa/qa/specs/features/project/create_issue_spec.rb
qa/qa/specs/features/project/create_issue_spec.rb
+1
-1
qa/qa/specs/features/project/create_spec.rb
qa/qa/specs/features/project/create_spec.rb
+1
-1
qa/qa/specs/features/project/deploy_key_clone_spec.rb
qa/qa/specs/features/project/deploy_key_clone_spec.rb
+1
-1
qa/qa/specs/features/project/fork_project_spec.rb
qa/qa/specs/features/project/fork_project_spec.rb
+1
-1
qa/qa/specs/features/project/import_from_github_spec.rb
qa/qa/specs/features/project/import_from_github_spec.rb
+1
-1
qa/qa/specs/features/project/pipelines_spec.rb
qa/qa/specs/features/project/pipelines_spec.rb
+1
-1
qa/qa/specs/features/project/wikis_spec.rb
qa/qa/specs/features/project/wikis_spec.rb
+1
-1
qa/qa/specs/features/repository/clone_spec.rb
qa/qa/specs/features/repository/clone_spec.rb
+1
-1
qa/qa/specs/features/repository/protected_branches_spec.rb
qa/qa/specs/features/repository/protected_branches_spec.rb
+1
-1
qa/qa/specs/features/repository/push_spec.rb
qa/qa/specs/features/repository/push_spec.rb
+1
-1
qa/qa/specs/runner.rb
qa/qa/specs/runner.rb
+7
-1
qa/spec/scenario/test/instance/all_spec.rb
qa/spec/scenario/test/instance/all_spec.rb
+4
-10
qa/spec/scenario/test/instance/smoke_spec.rb
qa/spec/scenario/test/instance/smoke_spec.rb
+45
-0
No files found.
doc/development/testing_guide/smoke.md
0 → 100644
View file @
d67936b6
# Smoke Tests
It is imperative in any testing suite that we have Smoke Tests. In short, smoke tests are will run quick sanity
end-to-end functional tests from GitLab QA and are designed to run against the specified environment to ensure that
basic functionality is working.
Currently, our suite consists of this basic functionality coverage:
-
User Login (Standard Auth)
-
Project Creation
-
Issue Creation
-
Merge Request Creation
---
[
Return to Testing documentation
](
index.md
)
doc/development/testing_guide/testing_levels.md
View file @
d67936b6
...
@@ -120,6 +120,14 @@ running feature tests (i.e. using Capybara) against it.
...
@@ -120,6 +120,14 @@ running feature tests (i.e. using Capybara) against it.
The actual test scenarios and steps are [part of GitLab Rails] so that they're
The actual test scenarios and steps are [part of GitLab Rails] so that they're
always in-sync with the codebase.
always in-sync with the codebase.
### Smoke tests
Smoke tests are quick tests that may be run at any time (especially after the pre-deployment migrations).
Much like feature tests - these tests run against the UI and ensure that basic functionality is working.
> See [Smoke Tests](smoke.md) for more information.
Read a separate document about
[
end-to-end tests
](
end_to_end_tests.md
)
to
Read a separate document about
[
end-to-end tests
](
end_to_end_tests.md
)
to
learn more.
learn more.
...
...
qa/README.md
View file @
d67936b6
...
@@ -35,7 +35,7 @@ following call would login to a local [GDK] instance and run all specs in
...
@@ -35,7 +35,7 @@ following call would login to a local [GDK] instance and run all specs in
`qa/specs/features`
:
`qa/specs/features`
:
```
```
bin/qa Test::Instance http://localhost:3000
bin/qa Test::Instance
::All
http://localhost:3000
```
```
### Writing tests
### Writing tests
...
@@ -48,14 +48,14 @@ You can also supply specific tests to run as another parameter. For example, to
...
@@ -48,14 +48,14 @@ You can also supply specific tests to run as another parameter. For example, to
run the repository-related specs, you can execute:
run the repository-related specs, you can execute:
```
```
bin/qa Test::Instance http://localhost qa/specs/features/repository/
bin/qa Test::Instance
::All
http://localhost qa/specs/features/repository/
```
```
Since the arguments would be passed to
`rspec`
, you could use all
`rspec`
Since the arguments would be passed to
`rspec`
, you could use all
`rspec`
options there. For example, passing
`--backtrace`
and also line number:
options there. For example, passing
`--backtrace`
and also line number:
```
```
bin/qa Test::Instance http://localhost qa/specs/features/project/create_spec.rb:3 --backtrace
bin/qa Test::Instance
::All
http://localhost qa/specs/features/project/create_spec.rb:3 --backtrace
```
```
### Overriding the authenticated user
### Overriding the authenticated user
...
@@ -67,7 +67,7 @@ If you need to authenticate as a different user, you can provide the
...
@@ -67,7 +67,7 @@ If you need to authenticate as a different user, you can provide the
`GITLAB_USERNAME`
and
`GITLAB_PASSWORD`
environment variables:
`GITLAB_USERNAME`
and
`GITLAB_PASSWORD`
environment variables:
```
```
GITLAB_USERNAME=jsmith GITLAB_PASSWORD=password bin/qa Test::Instance https://gitlab.example.com
GITLAB_USERNAME=jsmith GITLAB_PASSWORD=password bin/qa Test::Instance
::All
https://gitlab.example.com
```
```
If your user doesn't have permission to default sandbox group
If your user doesn't have permission to default sandbox group
...
@@ -75,13 +75,13 @@ If your user doesn't have permission to default sandbox group
...
@@ -75,13 +75,13 @@ If your user doesn't have permission to default sandbox group
`GITLAB_SANDBOX_NAME`
:
`GITLAB_SANDBOX_NAME`
:
```
```
GITLAB_USERNAME=jsmith GITLAB_PASSWORD=password GITLAB_SANDBOX_NAME=jsmith-qa-sandbox bin/qa Test::Instance https://gitlab.example.com
GITLAB_USERNAME=jsmith GITLAB_PASSWORD=password GITLAB_SANDBOX_NAME=jsmith-qa-sandbox bin/qa Test::Instance
::All
https://gitlab.example.com
```
```
In addition, the
`GITLAB_USER_TYPE`
can be set to "ldap" to sign in as an LDAP user:
In addition, the
`GITLAB_USER_TYPE`
can be set to "ldap" to sign in as an LDAP user:
```
```
GITLAB_USER_TYPE=ldap GITLAB_USERNAME=jsmith GITLAB_PASSWORD=password GITLAB_SANDBOX_NAME=jsmith-qa-sandbox bin/qa Test::Instance https://gitlab.example.com
GITLAB_USER_TYPE=ldap GITLAB_USERNAME=jsmith GITLAB_PASSWORD=password GITLAB_SANDBOX_NAME=jsmith-qa-sandbox bin/qa Test::Instance
::All
https://gitlab.example.com
```
```
All
[
supported environment variables are here
](
https://gitlab.com/gitlab-org/gitlab-qa#supported-environment-variables
)
.
All
[
supported environment variables are here
](
https://gitlab.com/gitlab-org/gitlab-qa#supported-environment-variables
)
.
...
...
qa/qa.rb
View file @
d67936b6
...
@@ -77,14 +77,16 @@ module QA
...
@@ -77,14 +77,16 @@ module QA
#
#
autoload
:Bootable
,
'qa/scenario/bootable'
autoload
:Bootable
,
'qa/scenario/bootable'
autoload
:Actable
,
'qa/scenario/actable'
autoload
:Actable
,
'qa/scenario/actable'
autoload
:Taggable
,
'qa/scenario/taggable'
autoload
:Template
,
'qa/scenario/template'
autoload
:Template
,
'qa/scenario/template'
##
##
# Test scenario entrypoints.
# Test scenario entrypoints.
#
#
module
Test
module
Test
autoload
:Instance
,
'qa/scenario/test/instance'
module
Instance
autoload
:All
,
'qa/scenario/test/instance/all'
autoload
:Smoke
,
'qa/scenario/test/instance/smoke'
end
module
Integration
module
Integration
autoload
:Github
,
'qa/scenario/test/integration/github'
autoload
:Github
,
'qa/scenario/test/integration/github'
...
...
qa/qa/scenario/taggable.rb
deleted
100644 → 0
View file @
c5bf09e7
module
QA
module
Scenario
module
Taggable
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def
tags
(
*
tags
)
@tags
=
tags
end
def
focus
@tags
.
to_a
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
end
end
end
qa/qa/scenario/template.rb
View file @
d67936b6
module
QA
module
QA
module
Scenario
module
Scenario
class
Template
class
Template
def
self
.
perform
(
*
args
)
class
<<
self
def
perform
(
*
args
)
new
.
tap
do
|
scenario
|
new
.
tap
do
|
scenario
|
yield
scenario
if
block_given?
yield
scenario
if
block_given?
break
scenario
.
perform
(
*
args
)
break
scenario
.
perform
(
*
args
)
end
end
end
end
def
perform
(
*
_args
)
def
tags
(
*
tags
)
raise
NotImplementedError
@tags
=
tags
end
def
focus
@tags
.
to_a
end
end
def
perform
(
address
,
*
rspec_options
)
Runtime
::
Scenario
.
define
(
:gitlab_address
,
address
)
Specs
::
Runner
.
perform
do
|
specs
|
specs
.
tty
=
true
specs
.
tags
=
self
.
class
.
focus
specs
.
options
=
if
rspec_options
.
any?
rspec_options
else
File
.
expand_path
(
'../../specs/features'
,
__dir__
)
end
end
end
end
end
end
end
end
...
...
qa/qa/scenario/test/instance.rb
deleted
100644 → 0
View file @
c5bf09e7
module
QA
module
Scenario
module
Test
##
# Base class for running the suite against any GitLab instance,
# including staging and on-premises installation.
#
class
Instance
<
Template
include
Bootable
extend
Taggable
tags
:core
def
perform
(
address
,
*
rspec_options
)
Runtime
::
Scenario
.
define
(
:gitlab_address
,
address
)
##
# Perform before hooks, which are different for CE and EE
#
Runtime
::
Release
.
perform_before_hooks
Specs
::
Runner
.
perform
do
|
specs
|
specs
.
tty
=
true
specs
.
tags
=
self
.
class
.
focus
specs
.
options
=
if
rspec_options
.
any?
rspec_options
else
::
File
.
expand_path
(
'../../specs/features'
,
__dir__
)
end
end
end
end
end
end
end
qa/qa/scenario/test/instance/all.rb
0 → 100644
View file @
d67936b6
module
QA
module
Scenario
module
Test
##
# Base class for running the suite against any GitLab instance,
# including staging and on-premises installation.
#
module
Instance
class
All
<
Template
include
Bootable
end
end
end
end
end
qa/qa/scenario/test/instance/smoke.rb
0 → 100644
View file @
d67936b6
module
QA
module
Scenario
module
Test
module
Instance
##
# Base class for running the suite against any GitLab instance,
# including staging and on-premises installation.
#
class
Smoke
<
Template
include
Bootable
tags
:smoke
end
end
end
end
end
qa/qa/specs/features/api/basics_spec.rb
View file @
d67936b6
require
'securerandom'
require
'securerandom'
module
QA
module
QA
describe
'API basics'
,
:core
do
describe
'API basics'
do
before
(
:context
)
do
before
(
:context
)
do
@api_client
=
Runtime
::
API
::
Client
.
new
(
:gitlab
)
@api_client
=
Runtime
::
API
::
Client
.
new
(
:gitlab
)
end
end
...
...
qa/qa/specs/features/api/users_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'API users'
,
:core
do
describe
'API users'
do
before
(
:context
)
do
before
(
:context
)
do
@api_client
=
Runtime
::
API
::
Client
.
new
(
:gitlab
)
@api_client
=
Runtime
::
API
::
Client
.
new
(
:gitlab
)
end
end
...
...
qa/qa/specs/features/login/basic_spec.rb
0 → 100644
View file @
d67936b6
module
QA
describe
'basic user login'
,
:smoke
do
it
'user logs in using basic credentials'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
# TODO, since `Signed in successfully` message was removed
# this is the only way to tell if user is signed in correctly.
#
Page
::
Menu
::
Main
.
perform
do
|
menu
|
expect
(
menu
).
to
have_personal_area
end
end
end
end
qa/qa/specs/features/login/ldap_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'LDAP user login'
,
:ldap
do
describe
'LDAP user login'
,
:
orchestrated
,
:
ldap
do
before
do
before
do
Runtime
::
Env
.
user_type
=
'ldap'
Runtime
::
Env
.
user_type
=
'ldap'
end
end
...
...
qa/qa/specs/features/mattermost/group_create_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'create a new group'
,
:mattermost
do
describe
'create a new group'
,
:
orchestrated
,
:
mattermost
do
it
'creating a group with a mattermost team'
do
it
'creating a group with a mattermost team'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
...
qa/qa/specs/features/mattermost/login_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'logging in to Mattermost'
,
:mattermost
do
describe
'logging in to Mattermost'
,
:
orchestrated
,
:
mattermost
do
it
'can use gitlab oauth'
do
it
'can use gitlab oauth'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
do
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
...
qa/qa/specs/features/merge_request/create_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'creates a merge request
'
,
:core
do
describe
'creates a merge request
with milestone'
do
it
'user creates a new merge request'
do
it
'user creates a new merge request'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
@@ -29,4 +29,25 @@ module QA
...
@@ -29,4 +29,25 @@ module QA
end
end
end
end
end
end
describe
'creates a merge request'
,
:smoke
do
it
'user creates a new merge request'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
current_project
=
Factory
::
Resource
::
Project
.
fabricate!
do
|
project
|
project
.
name
=
'project-with-merge-request'
end
Factory
::
Resource
::
MergeRequest
.
fabricate!
do
|
merge_request
|
merge_request
.
title
=
'This is a merge request'
merge_request
.
description
=
'Great feature'
merge_request
.
project
=
current_project
end
expect
(
page
).
to
have_content
(
'This is a merge request'
)
expect
(
page
).
to
have_content
(
'Great feature'
)
expect
(
page
).
to
have_content
(
/Opened [\w\s]+ ago/
)
end
end
end
end
qa/qa/specs/features/merge_request/rebase_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'merge request rebase'
,
:core
do
describe
'merge request rebase'
do
it
'rebases source branch of merge request'
do
it
'rebases source branch of merge request'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
...
qa/qa/specs/features/merge_request/squash_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'merge request squash commits'
,
:core
do
describe
'merge request squash commits'
do
it
'when squash commits is marked before merge'
do
it
'when squash commits is marked before merge'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
...
qa/qa/specs/features/project/activity_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'activity page'
,
:core
do
describe
'activity page'
do
it
'push creates an event in the activity page'
do
it
'push creates an event in the activity page'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
...
qa/qa/specs/features/project/add_deploy_key_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'deploy keys support'
,
:core
do
describe
'deploy keys support'
do
it
'user adds a deploy key'
do
it
'user adds a deploy key'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
...
qa/qa/specs/features/project/add_secret_variable_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'secret variables support'
,
:core
do
describe
'secret variables support'
do
it
'user adds a secret variable'
do
it
'user adds a secret variable'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
...
qa/qa/specs/features/project/auto_devops_spec.rb
View file @
d67936b6
require
'pathname'
require
'pathname'
module
QA
module
QA
describe
'Auto Devops'
,
:kubernetes
do
describe
'Auto Devops'
,
:
orchestrated
,
:
kubernetes
do
after
do
after
do
@cluster
&
.
remove!
@cluster
&
.
remove!
end
end
...
...
qa/qa/specs/features/project/create_issue_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'creates issue'
,
:
cor
e
do
describe
'creates issue'
,
:
smok
e
do
let
(
:issue_title
)
{
'issue title'
}
let
(
:issue_title
)
{
'issue title'
}
it
'user creates issue'
do
it
'user creates issue'
do
...
...
qa/qa/specs/features/project/create_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'create a new project'
,
:
cor
e
do
describe
'create a new project'
,
:
smok
e
do
it
'user creates a new project'
do
it
'user creates a new project'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
...
qa/qa/specs/features/project/deploy_key_clone_spec.rb
View file @
d67936b6
require
'digest/sha1'
require
'digest/sha1'
module
QA
module
QA
describe
'cloning code using a deploy key'
,
:
core
,
:
docker
do
describe
'cloning code using a deploy key'
,
:docker
do
def
login
def
login
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
...
qa/qa/specs/features/project/fork_project_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'Project fork'
,
:core
do
describe
'Project fork'
do
it
'can submit merge requests to upstream master'
do
it
'can submit merge requests to upstream master'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
...
qa/qa/specs/features/project/import_from_github_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'user imports a GitHub repo'
,
:
core
,
:github
do
describe
'user imports a GitHub repo'
,
:
orchestrated
,
:github
do
let
(
:imported_project
)
do
let
(
:imported_project
)
do
Factory
::
Resource
::
ProjectImportedFromGithub
.
fabricate!
do
|
project
|
Factory
::
Resource
::
ProjectImportedFromGithub
.
fabricate!
do
|
project
|
project
.
name
=
'imported-project'
project
.
name
=
'imported-project'
...
...
qa/qa/specs/features/project/pipelines_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'CI/CD Pipelines'
,
:
core
,
:docker
do
describe
'CI/CD Pipelines'
,
:
orchestrated
,
:docker
do
let
(
:executor
)
{
"qa-runner-
#{
Time
.
now
.
to_i
}
"
}
let
(
:executor
)
{
"qa-runner-
#{
Time
.
now
.
to_i
}
"
}
after
do
after
do
...
...
qa/qa/specs/features/project/wikis_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'Wiki Functionality'
,
:core
do
describe
'Wiki Functionality'
do
def
login
def
login
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
...
...
qa/qa/specs/features/repository/clone_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'clone code from the repository'
,
:core
do
describe
'clone code from the repository'
do
context
'with regular account over http'
do
context
'with regular account over http'
do
let
(
:location
)
do
let
(
:location
)
do
Page
::
Project
::
Show
.
act
do
Page
::
Project
::
Show
.
act
do
...
...
qa/qa/specs/features/repository/protected_branches_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'branch protection support'
,
:core
do
describe
'branch protection support'
do
let
(
:branch_name
)
{
'protected-branch'
}
let
(
:branch_name
)
{
'protected-branch'
}
let
(
:commit_message
)
{
'Protected push commit message'
}
let
(
:commit_message
)
{
'Protected push commit message'
}
let
(
:project
)
do
let
(
:project
)
do
...
...
qa/qa/specs/features/repository/push_spec.rb
View file @
d67936b6
module
QA
module
QA
describe
'push code to repository'
,
:core
do
describe
'push code to repository'
do
context
'with regular account over http'
do
context
'with regular account over http'
do
it
'user pushes code to the repository'
do
it
'user pushes code to the repository'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
...
...
qa/qa/specs/runner.rb
View file @
d67936b6
...
@@ -14,7 +14,13 @@ module QA
...
@@ -14,7 +14,13 @@ module QA
def
perform
def
perform
args
=
[]
args
=
[]
args
.
push
(
'--tty'
)
if
tty
args
.
push
(
'--tty'
)
if
tty
tags
.
to_a
.
each
{
|
tag
|
args
.
push
([
'-t'
,
tag
.
to_s
])
}
if
tags
.
any?
tags
.
each
{
|
tag
|
args
.
push
([
'-t'
,
tag
.
to_s
])
}
else
args
.
push
(
%w[-t ~orchestrated]
)
end
args
.
push
(
options
)
args
.
push
(
options
)
Runtime
::
Browser
.
configure!
Runtime
::
Browser
.
configure!
...
...
qa/spec/scenario/test/instance_spec.rb
→
qa/spec/scenario/test/instance
/all
_spec.rb
View file @
d67936b6
describe
QA
::
Scenario
::
Test
::
Instance
do
describe
QA
::
Scenario
::
Test
::
Instance
::
All
do
subject
do
Class
.
new
(
described_class
)
do
tags
:rspec
end
end
context
'#perform'
do
context
'#perform'
do
let
(
:arguments
)
{
spy
(
'Runtime::Scenario'
)
}
let
(
:arguments
)
{
spy
(
'Runtime::Scenario'
)
}
let
(
:release
)
{
spy
(
'Runtime::Release'
)
}
let
(
:release
)
{
spy
(
'Runtime::Release'
)
}
...
@@ -26,16 +20,16 @@ describe QA::Scenario::Test::Instance do
...
@@ -26,16 +20,16 @@ describe QA::Scenario::Test::Instance do
end
end
context
'no paths'
do
context
'no paths'
do
it
'
should call
runner with default arguments'
do
it
'
calls
runner with default arguments'
do
subject
.
perform
(
"test"
)
subject
.
perform
(
"test"
)
expect
(
runner
).
to
have_received
(
:options
=
)
expect
(
runner
).
to
have_received
(
:options
=
)
.
with
(
::
File
.
expand_path
(
'../../../qa/specs/features'
,
__dir__
))
.
with
(
::
File
.
expand_path
(
'../../../
../../
qa/specs/features'
,
__dir__
))
end
end
end
end
context
'specifying paths'
do
context
'specifying paths'
do
it
'
should call
runner with paths'
do
it
'
calls
runner with paths'
do
subject
.
perform
(
'test'
,
'path1'
,
'path2'
)
subject
.
perform
(
'test'
,
'path1'
,
'path2'
)
expect
(
runner
).
to
have_received
(
:options
=
).
with
(
%w[path1 path2]
)
expect
(
runner
).
to
have_received
(
:options
=
).
with
(
%w[path1 path2]
)
...
...
qa/spec/scenario/test/instance/smoke_spec.rb
0 → 100644
View file @
d67936b6
describe
QA
::
Scenario
::
Test
::
Instance
::
Smoke
do
subject
{
Class
.
new
(
described_class
)
{
tags
:smoke
}
}
context
'#perform'
do
let
(
:arguments
)
{
spy
(
'Runtime::Scenario'
)
}
let
(
:release
)
{
spy
(
'Runtime::Release'
)
}
let
(
:runner
)
{
spy
(
'Specs::Runner'
)
}
before
do
stub_const
(
'QA::Runtime::Release'
,
release
)
stub_const
(
'QA::Runtime::Scenario'
,
arguments
)
stub_const
(
'QA::Specs::Runner'
,
runner
)
allow
(
runner
).
to
receive
(
:perform
).
and_yield
(
runner
)
end
it
'sets an address of the subject'
do
subject
.
perform
(
"hello"
)
expect
(
arguments
).
to
have_received
(
:define
)
.
with
(
:gitlab_address
,
"hello"
)
end
it
'has a smoke tag'
do
expect
(
subject
.
focus
).
to
eq
([
:smoke
])
# rubocop:disable Focus
end
context
'no paths'
do
it
'calls runner with default arguments'
do
subject
.
perform
(
"test"
)
expect
(
runner
).
to
have_received
(
:options
=
)
.
with
(
File
.
expand_path
(
'../../../../../qa/specs/features'
,
__dir__
))
end
end
context
'specifying paths'
do
it
'calls runner with paths'
do
subject
.
perform
(
'test'
,
'path1'
,
'path2'
)
expect
(
runner
).
to
have_received
(
:options
=
).
with
(
%w[path1 path2]
)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment