Commit Graph

212 Commits

Author SHA1 Message Date
GitLab Bot 22a0d312ae Add latest changes from gitlab-org/gitlab@master 2020-01-17 18:08:41 +00:00
GitLab Bot 0820b29dca Add latest changes from gitlab-org/gitlab@master 2020-01-15 12:08:34 +00:00
GitLab Bot 01226c755d Add latest changes from gitlab-org/gitlab@master 2020-01-13 00:08:18 +00:00
GitLab Bot 775816e676 Add latest changes from gitlab-org/gitlab@master 2020-01-10 00:07:56 +00:00
GitLab Bot 5afd857550 Add latest changes from gitlab-org/gitlab@master 2020-01-09 09:07:51 +00:00
GitLab Bot 898e2cc1df Add latest changes from gitlab-org/gitlab@master 2019-12-20 09:24:38 +00:00
GitLab Bot aa10b541b6 Add latest changes from gitlab-org/gitlab@master 2019-12-09 09:08:00 +00:00
GitLab Bot c384315ae1 Add latest changes from gitlab-org/gitlab@master 2019-12-03 09:09:09 +00:00
GitLab Bot 5a3f1ba53b Add latest changes from gitlab-org/gitlab@master 2019-11-20 00:06:22 +00:00
GitLab Bot aaf124b0f7 Add latest changes from gitlab-org/gitlab@master 2019-11-18 21:06:19 +00:00
GitLab Bot 3fc9a8e695 Add latest changes from gitlab-org/gitlab@master 2019-11-15 12:06:12 +00:00
GitLab Bot 1ef4b65f55 Add latest changes from gitlab-org/gitlab@master 2019-11-08 06:06:24 +00:00
GitLab Bot 6026bddcd5 Add latest changes from gitlab-org/gitlab@master 2019-10-31 09:06:29 +00:00
GitLab Bot 25989ab7ef Add latest changes from gitlab-org/gitlab@master 2019-10-18 11:11:44 +00:00
GitLab Bot 03087faa6b Add latest changes from gitlab-org/gitlab@master 2019-10-15 15:06:07 +00:00
GitLab Bot 1cfd8874ee Add latest changes from gitlab-org/gitlab@master 2019-09-25 09:06:04 +00:00
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
GitLab Bot b7dfe2ae40 Add latest changes from gitlab-org/gitlab@master 2019-09-13 13:26:31 +00:00
Rémy Coutable d8f9890009
Reduce the CE/EE diff under qa/
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-08-14 10:22:25 +02:00
Stan Hu 3e001d29cc Enable Rubocop Performance/InefficientHashSearch
When used with a Hash, `.keys.include?` is bad because:

1. It performs a O(n) search instead of the efficient `.has_key?`
2. It clones all keys into separate array.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64975
2019-07-24 11:47:58 -07:00
Peter Leitzen 510d03fec2 QA: Prefer `flat_map` over `map` + `flatten` 2019-07-22 22:29:14 +00:00
ddavison 3281e6db23
Treat element#selector_css string appropriately
Proper escaping should be used for page/base.rb#scroll_to
as it is a single quoted JS string
2019-07-10 16:20:31 -07:00
ddavison 390e0d8906
Introduce data-qa-selector to supplant .qa-class
In order to break away from using CSS classes as
our primary method of element identification, we
need to provide the ability to search for data
attributes.

Make Test::Sanity::Selectors now work

Utilize regex to match on literal strings of the element name

Suggest the data-qa-selector pattern vs the qa-

Add data-qa-selector to login page to start

We need a page that is heavily used in order to be
confident that this functionality works. Let's start
with the Login page

Use appropriate HAML data tag practices
2019-07-10 16:09:43 -07:00
Mark Lapierre 7d97102f72 Run tests in parallel via parallel_tests
Uses the parallel_tests gem to execute tests in multiple processes
simultaneously on the same machine.

Adds the `--parallel` CLI option that instructs the QA framework
to use the parallel_tests executable.

Tests need access to global state contained in `Runtime::Scenario`
so when `--parallel` is invoked `Runtime::Scenario` is serialized
to an environment variable, which is passed to parallel_tests,
and then deserialized in `spec_helper`.
2019-07-09 15:40:46 +00:00
Grant Young eecd85d461 First pass at new automated QA API test for #52703
Checks that archives of two different user projects with the same name aren't the same via checksum.  I.E. a user can't download the archive of another's project by mistake.

To enable the test some enhancements were made.  Namely updating the client module to handle more than one API instance and the creation a custom rest call method that downloads to tmp.
2019-07-01 06:01:44 +00:00
Mark Lapierre cfe0043d54 Test push limit with admin user
Uses `:requires_admin` metadata to specify that a test needs
an admin user.

Sets the push file size limit test to require an admin user.

With an admin access token set as the env var
GITLAB_QA_ADMIN_ACCESS_TOKEN, the push size
limit test now only uses the API and CLI
2019-06-18 03:37:05 +00:00
Walmyr 8769eef340 Backport of EE changes from MR 13763
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13763
2019-06-14 05:07:29 +00:00
Mark Lapierre 5cccf313c3 Fix Web IDE add template test
Wait for the new file modal to stop animating before clicking it

We now need to click the commit button 3 times:
1. To enter commit mode
2. To being staging changes
3. To submit the commit
2019-06-05 08:46:30 +00:00
Mark Lapierre 3922c6da84 Generate knapsack report for review-qa-all
Add knapsack qa report and use it to run tests in parallel

Use the RSpec runner with knapsack

The way the Knapsack runner uses exec to start rspec seems
incompatible with the way we expect it to work. Plus, it requires
specifying KNAPSACK_TEST_DIR.

Instead, we use knapsacks AllocatorBuilder to select the spec
files to run, and then start rspec as normal, via
RSpec::Core::Runner.run

This also means we can incorporate tags.

Let the job run automatically

Include KNAPSACK_TEST_FILE_PATTERN in vars

Check all defined knapsack env vars before requiring knapsack
2019-06-03 10:37:43 +00:00
ddavison 7d5b68d837
Implement dynamic validation on QA Pages
Elements now have the ability to be required on pages or not
Currently using the default wait mechanism
Altered the ElementWithPattern Cop to fit new splat for init
2019-05-20 12:35:51 -07:00
Mark Lapierre ff6aa7906e Only retry failing QA tests in CI
No need to retry automatically when running tests locally
2019-05-20 17:09:47 +10:00
Sanad Liaquat 3061eee6ed Merge branch 'qa-ml-fix-branches-test' into 'master'
Fix E2E test - wait for branches to not be present

See merge request gitlab-org/gitlab-ce!27805
2019-05-13 11:14:15 +00:00
Mark Lapierre f00286bc0c Add branch_name qa selector
Uses the branch_name element to find a branch with a specific
name, instead of using a dynamic CSS class that can't be validated
by the sanity selector test
2019-05-07 12:43:10 +10:00
Mark Lapierre 3554736f23 Swap brackets to avoid false positive 2019-05-06 17:30:24 +10:00
Mark Lapierre f9e06897ad Escape arg used in regex 2019-05-06 13:07:31 +10:00
Sanad Liaquat 25af3a15fc Merge branch 'frozen_string_literal_qa' into 'master'
Add frozen_string_literal to qa/

See merge request gitlab-org/gitlab-ce!27266
2019-04-15 06:54:25 +00:00
Thong Kuah 0be52bf32f Add frozen_string_literal to qa/
This will be default in Ruby 3, so will be good to apply in QA ahead of
time to be consistent.
2019-04-13 00:45:38 +12:00
Thong Kuah f38f160a1b Enable RSpec/ExampleWording cop 2019-04-12 10:27:19 +00:00
Sanad Liaquat 0991dc8c82 Reduce number of rspec retries
In both e2e QA tests and unit tests, reduce the number of retires
to 2 (i.e., 1 initial and one retry)
2019-04-09 10:04:03 +00:00
Mark Lapierre 35c5557685 Allow token env var from gitlab-qa
gitlab-qa accepts an env var named GITLAB_QA_ACCESS_TOKEN, but here we
only accepted PERSONAL_ACCESS_TOKEN.

This change replaces PERSONAL_ACCESS_TOKEN with GITLAB_QA_ACCESS_TOKEN
2019-03-28 08:15:14 +00:00
Mark Lapierre 67c38a6573 Set feature flag via command line
First attempt at allowing a feature flag to be set via the command line
when running tests. This will enable the flag, run the tests, and then
disable the flag.

Using OptionParser meant changing how scenarios get the instance
address, so this also allows the address to be set as a command line
option. It's backwards compatible (you can still provide the address
as the command line option after the scenario)
2019-03-27 19:03:03 +00:00
Mark Lapierre c6a6b8a24e Skip contexts in quarantine
This avoids running before/after blocks for tests that are in quarantine
2019-03-11 11:50:09 +00:00
Rémy Coutable 95b5832366
[QA] Fail early if a Git command fails
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-02-28 18:15:51 +01:00
Sanad Liaquat ddef2f1fbd Update GitHub Import test
Removes the unnecessary :orchestrated tag and updates a few
selectors. Also wait_for_success for import before proceeding.
The test is currently placed in quarantine because of a bug.
2019-02-25 18:37:27 +05:00
Sanad Liaquat d54cb37d29 Retry failed tests with rspec-retry
Does not retry if tagged :quarantine. Also adds unit tests.
2019-02-19 17:12:07 +05:00
Mark Lapierre e5e57df61c Move server responding check to scenario before hook
This checks that the server is responding before any other actions,
including before trying to add a license.
2019-02-14 12:06:39 -05:00
Mark Lapierre 8931420202 Skip contexts in quarantine
This avoids running before/after blocks for tests that are in quarantine
2019-02-14 04:35:20 +00:00
Mark Lapierre 97265d39e7 [CE] Improve `wait_for_push` 2019-02-11 09:04:59 +00:00
Sanad Liaquat 621b92120e Load login page only if gitlab_address is defined 2019-02-07 11:00:47 +05:00
Sanad Liaquat 784eb9a430 Wait for login page to load at the beginning of QA suite 2019-02-07 10:00:51 +05:00
Sanad Liaquat e8f8adfe27 Add e2e QA test for logging in using GitHub OAuth
Adds the test itself and the vendor page object model for GitHub
login pages.
2019-02-01 10:50:24 +05:00
Rémy Coutable c1e9b9e8a8 Merge branch 'qa-ml-improve-git-repo-auth' into 'master'
Add git credentials to .netrc when needed

Closes gitlab-org/quality/nightly#57 and #56857

See merge request gitlab-org/gitlab-ce!24691
2019-01-31 08:52:32 +00:00
Mark Lapierre f653952202 Don't use .netrc with SSH
There was a bug that required credentials when using SSH key auth when
using LFS. That bug was fixed so we shouldn't need to add credentials to
.netrc when using SSH anymore.
2019-01-30 15:16:37 -05:00
Andrew Newdigate ff0b2cc61f Re-enable MethodCallWithoutArgsParentheses Cop
Re-enables and autocorrects all instances of the
Style/MethodCallWithoutArgsParentheses rule
2019-01-29 21:05:30 +02:00
Mark Lapierre 02c3c9dad5 Add git credentials to .netrc when needed
Avoid having to remember to call try_add_credentials_to_netrc
after setting credentials.
2019-01-28 15:28:42 -05:00
Mark Lapierre dbb5324881 Fix failing E2E test
Sometimes add_list_delete_branches_spec.rb would not wait after
deleting a branch before checking that the branch was done. It would
fail when the UI was still processing.

This checks that the loading icon is gone before returning from
delete_branch.

It also makes sure credentials are added properly after recent changes
to QA::Git::Repository
2019-01-25 09:07:55 -05:00
Rémy Coutable cbc3d1f911
[QA] Use public_email instead of email since it's available
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-23 13:17:05 +01:00
Mark Lapierre 1d22498251 Fix Resource attribute bug
Allow Resources to have the same attribute name
but different attribute values
2019-01-15 15:39:19 -05:00
Rémy Coutable f48f9460fd
[QA] Retrieve the current user name and email
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-10 14:30:57 +01:00
ddavison 7f780046c4 Add specs to remote grid. Raise errors for #remote_grid_credentials
Signed-off-by: ddavison <ddavison@gitlab.com>
2019-01-09 12:02:56 +05:00
Mark Lapierre f1b36aa46c Quarantine spec code review changes
- Clarify message shown when skipping quarantined tests because
they don't have all the specified tags.
- Simplify rejecting item from array
- Remove 'pass' from example descriptions to avoid confusion
2019-01-08 11:07:58 -05:00
Mark Lapierre 7d9262427f Skip quarantined tests via filters
Instead of modifying the runner, use config hooks to skip quarantined
tests, and to allow only quarantined tests to be run, if desired.

This way quarantined tests are skipped, not excluded completely, so
they are still included in test results.
2019-01-08 10:45:37 -05:00
Mark Lapierre e5a81aec1f Revert "Allow tests to be quarantined"
This reverts commit 8ef418d57c.
2019-01-08 10:45:37 -05:00
Mark Lapierre 89a7928235 Allow tests to be quarantined
Exclude quarantined tests by default.
2019-01-08 10:45:37 -05:00
Mark Lapierre 8299df7593 Wait for Web IDE commit animation
Wait for the "Commit..." button to disappear and the "Stage & Commit"
button to appear before clicking the latter button. The animation that
is shown while changing the buttons must complete before clicking
"Stage & Commit" will have any effect _even if_ the button is visible
before the animation is complete.
2019-01-07 15:33:55 -05:00
Mark Lapierre 441dee4c31 Log text_filter arg of find_element 2018-12-28 13:15:46 -05:00
Mark Lapierre cbfc00a1e5 Backport page object changes from EE
Add new page object methods from EE MR:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8937
2018-12-20 08:48:10 -05:00
Nick Thomas 068e75f660 Merge branch 'ml-qa-git-protocol-v2-spec' into 'master'
Add e2e test of push over SSH using Git protocol v2

See merge request gitlab-org/gitlab-ce!22548
2018-11-08 00:13:51 +00:00
Mark Lapierre 765ca40d65 Add e2e test of push over SSH over Git protocol v2
Adds a new end-to-end test to check that Git protocol v2 can be used to
push over SSH.

Includes a change in Git::Repository to use Runtime::Env.debug? to
enable logging instead of .verbose?
2018-11-07 12:16:17 -05:00
Lin Jen-Shin 4d0fd75cd5 Rename QA::Factory to QA::Resource
* Factory::Base -> Resource::Base, and therefore:
* Factory::Resource::Project -> Resource::Project
2018-11-05 22:20:57 +08:00
Grzegorz Bizon 8ceb3dc341 Merge branch 'ml-create-user-via-api-qa' into 'master'
Create users via the API

See merge request gitlab-org/gitlab-ce!22779
2018-11-05 10:03:45 +00:00
Mark Lapierre 190afc62fb Create users via the API
Allows users to be fetched/created via the API.
2018-11-02 14:27:28 -04:00
Mark Lapierre e614af0b01 Don't log fabricate args
Prevents logging of sensitive data
2018-11-02 10:50:15 -04:00
Lin Jen-Shin e7741b0e52 CE: Absorb product into factory 2018-10-31 02:44:47 +00:00
Stan Hu 1815aa561a Merge branch 'qa-59-ldap-ssl-scenario' into 'master'
E2E Test - LDAP login with SSL

Closes gitlab-qa#59

See merge request gitlab-org/gitlab-ce!22574
2018-10-26 15:59:49 +00:00
Robert Speicher 08d946e209 Merge branch 'ml-qa-repo-logging' into 'master'
Re-enable debug logging of Git commands and output

See merge request gitlab-org/gitlab-ce!22608
2018-10-25 22:21:32 +00:00
Lin Jen-Shin 5151801964 Always use `attribute` to define the product 2018-10-25 20:29:24 +00:00
Mark Lapierre a85c8e346f Re-enable debug logging of Git commands and output 2018-10-25 15:21:21 -04:00
Sanad Liaquat f49034ba49 Rename SSL to TLS 2018-10-25 13:11:19 +05:00
Sanad Liaquat 7983c798af Renamed to ldap_no_ssl and ldap_ssl 2018-10-24 17:43:30 +05:00
Douglas Barbosa Alexandre 5adf178157 Merge branch 'qa-backport-recent-ee-changes' into 'master'
[QA] Port recent changes from EE

See merge request gitlab-org/gitlab-ce!22391
2018-10-22 15:50:11 +00:00
Rémy Coutable e5f01cc8a1
[QA] Port recent changes from EE
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-10-22 10:03:11 +02:00
Mark Lapierre 45860bc807 Log page actions
Override page object methods to log the actions taken by the methods
before or after the action, as appropriate.

Allow page object action logging to be turned on via a QA_DEBUG env var.
Unlike CHROME_HEADLESS (and the soon to arrive VERBOSE), QA_DEBUG
is false by default.

QA_DEBUG is used instead of just DEBUG because that enables Selenium
debug logging.

Mask passwords entered into fields with a QA selector with 'password'
in the name. Doesn't mask sensitive data entered into any other field.
2018-10-19 18:32:33 -04:00
Rémy Coutable 329aa24920 Merge branch 'ml-qa-code-owners' into 'master'
QA: Add support for pushing and viewing files

See merge request gitlab-org/gitlab-ce!21911
2018-10-18 09:46:27 +00:00
Mark Lapierre c57ac00006 Add support for pushing and viewing files
The MR below adds a test for the code owners feature. This adds the
part of those changes specific to CE - the ability to add and view
files in a project.

https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7368
2018-10-17 15:18:22 -04:00
Rémy Coutable b6f2f738c7 First iteration to allow creating QA resources using the API 2018-10-17 18:08:20 +00:00
Rémy Coutable 1db52c79ad
Disable the QA/ElementWithPattern cop for existing offenses
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-10-15 17:55:53 +02:00
Sanad Liaquat 154ce29d05 Initial commit
Use ACCEPT_INSECURE_CERTS env var and fix step

Simplify saml signin

Fix rubo cop offence

Add missing # frozen_string_literal: true
2018-10-11 13:19:53 +05:00
Mark Lapierre 03ee488f93 Allow the registration e2e test to be skipped
If SIGNUP_DISABLED is true skip any tests with a context
:skip_signup_disabled. The context is set for the registration tests.
This allows the tests to be skipped when run on the staging, which
doesn't allow registration
2018-10-08 15:04:08 -04:00
Rémy Coutable 182966312f
[QA] Improve admin hashed-storage settings
This was introduced by https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7371
for which no QA was run, even though QA files were changed.

This is a follow-up to
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7531.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-10-02 12:11:44 +02:00
Mark Lapierre 28e80dbcc5 Enable signing in as admin when adding a license
Adds the ability to use admin credentials to add a license so that when
testing an LDAP user on EE the LDAP user does not have to be an admin.

Admin credentials default to GDK's root user. Can be overriden via
ADMIN_USERNAME and ADMIN_PASSWORD environment variables.
2018-09-10 18:43:34 -04:00
Rémy Coutable 816e846a43 Merge branch 'qa-fix-specs-runner-when-args-given' into 'master'
[QA] Fix arguments passed to RSpec::Core::Runner

See merge request gitlab-org/gitlab-ce!21578
2018-09-10 10:53:21 +00:00
Rémy Coutable dd85ea6a9d
[QA] Fix arguments passed to RSpec::Core::Runner
- When -t or --tag are passed, we shouldn't exclude the :orchestrated tag
- When test path is passed, we shouldn't append the default test path

Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-09-07 00:55:07 +02:00
Rémy Coutable cbae3e974d
[QA] Change Test::Sanity::Failing to Test::Sanity::Framework
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-09-06 17:53:23 +02:00
Rémy Coutable 144b017d77
[QA] Fix Specs::Runner that would always excluding the orchectsrated tag
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-09-04 19:34:12 +02:00
Rémy Coutable 520fcaab1c
Allow to pass --tag to bin/qa run
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-08-28 16:32:59 +02:00
Grzegorz Bizon d5cd1c4aff Merge branch 'qa-staging-2' into 'master'
[QA] Improve the fork scenario to take a username and password instead of always…

Closes gitlab-org/quality/staging#2

See merge request gitlab-org/gitlab-ce!21090
2018-08-21 07:33:14 +00:00
Dan Davison c147c3eff2 fix broken pathing (remove extraneous ../) 2018-08-21 07:10:27 +00:00
Dan Davison d67936b68f add initial smoke tests and documentation 2018-08-20 18:13:54 +00:00
Rémy Coutable 98ba19b5f2
[QA] Improve the fork scenario to take a username and password instead of always creating a new user
Fixes https://gitlab.com/gitlab-org/quality/staging/issues/2.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-08-20 10:52:24 +02:00