Commit 70de310b authored by Sofia Vistas's avatar Sofia Vistas

Add package manager pypi install test

parent 106f6bec
...@@ -26,10 +26,10 @@ module QA ...@@ -26,10 +26,10 @@ module QA
end end
end end
let(:gitlab_address_with_port) do let(:uri) { URI.parse(Runtime::Scenario.gitlab_address) }
uri = URI.parse(Runtime::Scenario.gitlab_address) let(:gitlab_address_with_port) { "#{uri.scheme}://#{uri.host}:#{uri.port}" }
"#{uri.scheme}://#{uri.host}:#{uri.port}" let(:gitlab_host_with_port) { "#{uri.host}:#{uri.port}" }
end let(:personal_access_token) { Runtime::Env.personal_access_token }
before do before do
Flow::Login.sign_in Flow::Login.sign_in
...@@ -42,14 +42,25 @@ module QA ...@@ -42,14 +42,25 @@ module QA
content: content:
<<~YAML <<~YAML
image: python:latest image: python:latest
stages:
- run
- install
run: run:
stage: run
script: script:
- pip install twine - pip install twine
- python setup.py sdist bdist_wheel - python setup.py sdist bdist_wheel
- "TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url #{gitlab_address_with_port}/api/v4/projects/${CI_PROJECT_ID}/packages/pypi dist/*" - "TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url #{gitlab_address_with_port}/api/v4/projects/${CI_PROJECT_ID}/packages/pypi dist/*"
tags: tags:
- "runner-for-#{project.name}" - "runner-for-#{project.name}"
install:
stage: install
script:
- "pip install mypypipackage --no-deps --index-url http://#{personal_access_token}:#{personal_access_token}@#{gitlab_host_with_port}/api/v4/projects/${CI_PROJECT_ID}/packages/pypi/simple --trusted-host #{gitlab_host_with_port}"
tags:
- "runner-for-#{project.name}"
YAML YAML
}, },
{ {
...@@ -87,6 +98,16 @@ module QA ...@@ -87,6 +98,16 @@ module QA
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_successful(timeout: 800) expect(job).to be_successful(timeout: 800)
end end
Flow::Pipeline.visit_latest_pipeline
Page::Project::Pipeline::Show.perform do |pipeline|
pipeline.click_job('install')
end
Page::Project::Job::Show.perform do |job|
expect(job).to be_successful(timeout: 800)
end
end end
after do after do
...@@ -95,7 +116,8 @@ module QA ...@@ -95,7 +116,8 @@ module QA
project&.remove_via_api! project&.remove_via_api!
end end
it 'publishes a pypi package and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1087' do context 'when at the project level' do
it 'publishes and installs a pypi package and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1087' do
Page::Project::Menu.perform(&:click_packages_link) Page::Project::Menu.perform(&:click_packages_link)
Page::Project::Packages::Index.perform do |index| Page::Project::Packages::Index.perform do |index|
...@@ -112,6 +134,7 @@ module QA ...@@ -112,6 +134,7 @@ module QA
end end
end end
end end
end
context 'Geo', :orchestrated, :geo do context 'Geo', :orchestrated, :geo do
it 'replicates a published pypi package to the Geo secondary site', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1120', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/325556', type: :investigating } do it 'replicates a published pypi package to the Geo secondary site', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1120', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/325556', type: :investigating } do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment