Skip to content

Commit

Permalink
[dist] Simplify package smoketest
Browse files Browse the repository at this point in the history
  • Loading branch information
hennevogel committed Mar 23, 2017
1 parent d3bd191 commit c3a6033
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 144 deletions.
73 changes: 73 additions & 0 deletions dist/t/spec/features/0040_package_spec.rb
@@ -0,0 +1,73 @@
require "spec_helper"

RSpec.describe "Package" do
before(:context) do
login
end

after(:context) do
logout
end

it "should be able to create new" do
within("div#subheader") do
click_link('Home Project')
end
click_link('Create package')
fill_in 'name', with: 'ctris'
fill_in 'title', with: 'ctris'
fill_in 'description', with: 'ctris'
click_button('Save changes')
expect(page).to have_content("Package 'ctris' was created successfully")
end

it "should be able to upload files" do
within("div#subheader") do
click_link('Home Project')
end
click_link('ctris')
click_link('Add file')
attach_file("file", File.expand_path('../../fixtures/ctris.spec', __FILE__))
click_button('Save changes')
expect(page).to have_content("The file 'ctris.spec' has been successfully saved.")

# second line of defense ;-)
click_link('Add file')
attach_file("file", File.expand_path('../../fixtures/ctris-0.42.tar.bz2', __FILE__))
click_button('Save changes')
expect(page).to have_content("The file 'ctris-0.42.tar.bz2' has been successfully saved.")
end

it "should be able to branch" do
within("div#subheader") do
click_link('Home Project')
end
click_link('Branch existing package')
fill_in 'linked_project', with: 'openSUSE.org:OBS:Server:Unstable'
fill_in 'linked_package', with: 'build'
# Do not wait for autocomplete
page.execute_script("$('input[type=\"submit\"]').prop('disabled', false)")
click_button('Create Branch')
expect(page).to have_content('Successfully branched package')
end

it 'should be able to delete' do
click_link('Delete package')
expect(page).to have_content('Do you really want to delete this package?')
click_button('Ok')
expect(page).to have_content('Package was successfully removed.')
end

it "should be able to successfully build" do
100.downto(1) do |counter|
visit("/package/show/home:Admin/ctris")
# wait for the build results ajax call
sleep(5)
puts "Refreshed build results, #{counter} retries left."
succeed_build = page.all('td', class: 'status_succeeded')
if succeed_build.length == 1
break
end
end
end
end
74 changes: 0 additions & 74 deletions dist/t/spec/features/0040_prepare_package_building_spec.rb

This file was deleted.

70 changes: 0 additions & 70 deletions dist/t/spec/features/0060_build_result_spec.rb

This file was deleted.

Binary file added dist/t/spec/fixtures/ctris-0.42.tar.bz2
Binary file not shown.
31 changes: 31 additions & 0 deletions dist/t/spec/fixtures/ctris.spec
@@ -0,0 +1,31 @@
Name: ctris
Summary: Console based tetris clone
URL: http://www.hackl.dhs.org/ctris/
Group: Amusements/Games/Action/Arcade
License: GPL
Version: 0.42
Release: 1
Source0: %{name}-%{version}.tar.bz2
BuildRequires: ncurses-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build

%description
ctris is a colorized, small and flexible Tetris(TM)-clone for the console. Go play!

%prep
%setup -q

%build
make CFLAGS="$RPM_OPT_FLAGS"

%install
make install DESTDIR=$RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT;

%files
%defattr (-,root,root)
%doc AUTHORS COPYING README TODO
%doc %{_mandir}/man6/ctris.6.gz
/usr/games/ctris

0 comments on commit c3a6033

Please sign in to comment.