Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests work on f25 #14

Merged
merged 4 commits into from
Jan 5, 2017
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
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ services:
- docker

before_script:
- cd dev-tools/docker
- sudo docker-compose build ci
- cd $TRAVIS_BUILD_DIR
- docker pull mmornati/mock-rpmbuilder:v1.0

script:
- cd dev-tools/docker
- sudo docker-compose run ci /usr/bin/prove -lrcf t
- cd $TRAVIS_BUILD_DIR
- make dockertest
- make rpmtest
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ rpmbuild: $(VERSION).tar.gz
rpmtest: rpmbuild
find $(BUILDDIR)/output -name 'rpmgrill-*.noarch.rpm' | egrep '.*'

.PHONY: dockertest
dockertest: dev-tools/docker/docker-compose.yml
for target in `egrep -o '^test_\w+' $<`; do \
docker-compose -f $< build $$target; \
docker-compose -f $< run $$target /usr/bin/prove -lrcf t || exit 1; \
done

# Shortcut names for the above
.PHONY: tarball srpm
tarball: $(VERSION).tar.gz
Expand Down
12 changes: 8 additions & 4 deletions dev-tools/docker/README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ This repository contains docker files relating to RpmGrill.

Image Reference
---------------
ci::
`ci` image is based on `Fedora 24` and contains all dependencies needed to
run `RpmGrill` tests. This image is used in our Travis CI environment.
test_f25::
This image is based on `Fedora 25` and contains all dependencies
needed to run `RpmGrill` tests. This image is used in our Travis CI
environment.
test_f24::
This image is based on `Fedora 24` to provide the environment of the current
maintenance distribution.

Building Images
~~~~~~~~~~~~~~~~
Expand All @@ -30,5 +34,5 @@ Use docker-compose `run` to use docker image.

[source, bash]
----
$ docker-compose run ci
$ docker-compose run test_f25
----
27 changes: 27 additions & 0 deletions dev-tools/docker/ci/f25/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM fedora:25
MAINTAINER rpmdiff-maint@redhat.com

### setup installs /usr/share/doc/setup-*/uidgid ###
### need by rpmgrill so ensure docs are installed ###
RUN dnf reinstall -y setup && \
dnf -y clean all

### test dependencies ###
RUN dnf install -y \
tar bzip2 desktop-file-utils rpm-build redhat-rpm-config \
clamav clamav-data elfutils koji git libxslt \
clamav clamav-data elfutils koji git libxslt perl-Test-Harness \
perl-Test-Perl-Critic perl-HTML-Parser perl-XML-Simple perl-JSON-XS \
perl-YAML perl-File-LibMagic perl-Test-Differences perl-IPC-Run \
perl-Sort-Versions perl-Digest-SHA1 perl-File-Slurp \
perl-Test-LongString perl-Time-ParseDate perl-YAML-Syck \
perl-Time-Piece perl-CGI perl-Test-Deep perl-Module-Build \
perl-Net-DNS perl-Pod-POM perl-Test-MockObject perl-XMLRPC-Lite \
perl-SOAP-Lite perl-Devel-Cover perl-Test-Exception \
perl-File-Fetch perl-List-AllUtils perl-Test-MockModule \
perl-open perl-boolean && \
dnf -y clean all


WORKDIR /code
CMD bash
12 changes: 9 additions & 3 deletions dev-tools/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
### minimal env to test rpmgrill ###
ci:
# current maintenance release
test_f24:
build: ci/f24
privileged: true
volumes:
- ../../:/code
- ../../../:/project
- &code ../../:/code

# stable release
test_f25:
build: ci/f25
privileged: true
volumes:
- *code
2 changes: 1 addition & 1 deletion lib/RPM/Grill/Plugin/RpmScripts.pm
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ sub _check_generic_add {

# There must be exactly one argument remaining, and that's the
# name of the user or group to be added.
my $arg = shift(\@words)
my $arg = shift(@{words})
or do {
# FIXME: this deserves a gripe
warn "$ME: WARNING: no user/group/etc in '$cmd'";
Expand Down
7 changes: 6 additions & 1 deletion t/RPM/Grill/RPM/Files/30file_type.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,18 @@ for my $t (@tests) {

write_file($filename, $t->{content});

# Invoke the file command with peeking into gzip archives and short output.
# Use that as an expectation we assert against.
my $expected = qx(file -z -b $filename);
chomp($expected);

my $obj = bless {
extracted_path => $filename,
}, 'RPM::Grill::RPM::Files';

my $actual_type = $obj->file_type;

is_string $actual_type, $t->{expected_type}, $filename;
is_string $actual_type, $expected, $filename;
}

# Allow cleanup
Expand Down
2 changes: 1 addition & 1 deletion t/RPM/Grill/Util/10sanitize_text.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ my @tests = (
[ 'ccc&d' => 'ccc&amp;d' ], # HTML special char
[ 'cccd' => 'ccc[^V]d' ], # ctrl character
[ 'Muñoz' => 'Muñoz' ], # UTF-8 passthru
[ "Mu\361oz" => 'Mu&amp;#241;oz' ], # GAH! non-utf8
[ "Mu\361loloz" => 'Mu&amp;#241;loloz' ], # GAH! non-utf8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣

[ "Embedded\011tab" => "Embedded\011tab" ],
[ "Embedded\012newline" => "Embedded\012newline" ],
);
Expand Down