Skip to content

Commit

Permalink
Merge pull request #127 from samvera-labs/fixture_cleanup
Browse files Browse the repository at this point in the history
Exclude tests from gem build, cleanup fixtures
  • Loading branch information
masaball authored Jun 21, 2023
2 parents a56a502 + 676714d commit f35a797
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 25 deletions.
3 changes: 1 addition & 2 deletions active_encode.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/samvera-labs/active_encode"
spec.license = "Apache-2.0"

spec.files = `git ls-files -z`.split("\x0")
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
spec.metadata = { "rubygems_mfa_required" => "true" }

Expand Down
2 changes: 1 addition & 1 deletion lib/active_encode/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true
module ActiveEncode
VERSION = '1.2.0'
VERSION = '1.2.1'
end
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified spec/fixtures/file_without_metadata.low.webm
Binary file not shown.
Binary file modified spec/fixtures/file_without_metadata.mp4
Binary file not shown.
Binary file modified spec/fixtures/file_without_metadata.webm
Binary file not shown.
8 changes: 4 additions & 4 deletions spec/integration/elastic_transcoder_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
end
context "when filename has special characters" do
context "non-s3 file" do
let(:input) { ["'file_with_single_quote'.mp4", '"file_with_double_quote".mp4', "file with space.mp4", "file.with...periods.mp4", "file.with :=+%sp3c!l-ch4cts().mp4", '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov'] }
let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mov'] }
let(:input) { ["'file_with_single_quote'.mp4", '"file_with_double_quote".mp4', "file with space.mp4", "file.with...periods.mp4", "file.with :=+%sp3c!l-ch4cts().mp4", '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4'] }
let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mp4'] }
let(:source_bucket) { "bucket1" }

it "calls the #upload_to_s3 method" do
Expand All @@ -171,8 +171,8 @@
end
end
context "s3 file" do
let(:input_urls) { ["s3://bucket1/'file_with_single_quote'.mp4", 's3://bucket1/"file_with_double_quote".mp4', "s3://bucket1/file with space.mp4", "s3://bucket1/file.with...periods.mp4", "s3://bucket1/file.with :=+%sp3c!l-ch4cts().mp4", 's3://bucket1/@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov'] }
let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mov'] }
let(:input_urls) { ["s3://bucket1/'file_with_single_quote'.mp4", 's3://bucket1/"file_with_double_quote".mp4', "s3://bucket1/file with space.mp4", "s3://bucket1/file.with...periods.mp4", "s3://bucket1/file.with :=+%sp3c!l-ch4cts().mp4", 's3://bucket1/@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4'] }
let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mp4'] }
let(:source_bucket) { "bucket2" }

it "calls the #check_s3_bucket method" do
Expand Down
12 changes: 6 additions & 6 deletions spec/integration/ffmpeg_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def find_encode(id)
end

it "assigns the correct duration to the encode" do
expect(create_without_metadata_job.input.duration).to eq 68_653
expect(find_without_metadata_job.input.duration).to eq 68_653
expect(create_without_metadata_job.input.duration).to eq 4_640
expect(find_without_metadata_job.input.duration).to eq 4_640
end

context 'when uri encoded' do
Expand All @@ -162,8 +162,8 @@ def find_encode(id)
end

it "assigns the correct duration to the encode" do
expect(create_without_metadata_job.input.duration).to eq 68_653
expect(find_without_metadata_job.input.duration).to eq 68_653
expect(create_without_metadata_job.input.duration).to eq 4_640
expect(find_without_metadata_job.input.duration).to eq 4_640
end
end
end
Expand Down Expand Up @@ -280,7 +280,7 @@ def find_encode(id)
let(:file_with_special_characters) { "file://" + Rails.root.join('..', 'spec', 'fixtures', 'file.with :=+%sp3c!l-ch4cts().mp4').to_s }
let!(:create_special_characters_job) { ActiveEncode::Base.create(file_with_special_characters, outputs: [{ label: "low", ffmpeg_opt: "-s 640x480", extension: 'mp4' }]) }
let(:find_special_characters_job) { ActiveEncode::Base.find create_special_characters_job.id }
let(:file_with_more_special_characters) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s }
let(:file_with_more_special_characters) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s }
let!(:create_more_special_characters_job) { ActiveEncode::Base.create(file_with_more_special_characters, outputs: [{ label: "low", ffmpeg_opt: "-s 640x480", extension: 'mp4' }]) }
let(:find_more_special_characters_job) { ActiveEncode::Base.find create_more_special_characters_job.id }

Expand All @@ -302,7 +302,7 @@ def find_encode(id)

context 'when uri encoded' do
let(:file_with_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', 'file.with :=+%sp3c!l-ch4cts().mp4').to_s) }
let(:file_with_more_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s) }
let(:file_with_more_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s) }

it "does not have errors" do
sleep 2
Expand Down
8 changes: 4 additions & 4 deletions spec/integration/media_convert_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ def reconstitute_response(fixture_path)
end
context "when filename has special characters" do
context "non-s3 file" do
let(:input) { ["'file_with_single_quote'.mp4", '"file_with_double_quote".mp4', "file with space.mp4", "file.with...periods.mp4", "file.with :=+%sp3c!l-ch4cts().mp4", '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov'] }
let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mov'] }
let(:input) { ["'file_with_single_quote'.mp4", '"file_with_double_quote".mp4', "file with space.mp4", "file.with...periods.mp4", "file.with :=+%sp3c!l-ch4cts().mp4", '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4'] }
let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mp4'] }
let(:source_bucket) { "bucket1" }

it "calls the #upload_to_s3 method" do
Expand All @@ -305,8 +305,8 @@ def reconstitute_response(fixture_path)
end
end
context "s3 file" do
let(:input_urls) { ["s3://bucket1/'file_with_single_quote'.mp4", 's3://bucket1/"file_with_double_quote".mp4', "s3://bucket1/file with space.mp4", "s3://bucket1/file.with...periods.mp4", "s3://bucket1/file.with :=+%sp3c!l-ch4cts().mp4", 's3://bucket1/@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov'] }
let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mov'] }
let(:input_urls) { ["s3://bucket1/'file_with_single_quote'.mp4", 's3://bucket1/"file_with_double_quote".mp4', "s3://bucket1/file with space.mp4", "s3://bucket1/file.with...periods.mp4", "s3://bucket1/file.with :=+%sp3c!l-ch4cts().mp4", 's3://bucket1/@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4'] }
let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mp4'] }
let(:source_bucket) { "bucket2" }

it "calls the #check_s3_bucket method" do
Expand Down
16 changes: 8 additions & 8 deletions spec/integration/pass_through_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def touch_fixture(id, filename)
end

it "assigns the correct duration to the encode" do
expect(create_without_metadata_job.input.duration).to eq 68_653
expect(find_without_metadata_job.input.duration).to eq 68_653
expect(create_without_metadata_job.input.duration).to eq 4_640
expect(find_without_metadata_job.input.duration).to eq 4_640
end

context 'when uri encoded' do
Expand All @@ -151,8 +151,8 @@ def touch_fixture(id, filename)
end

it "assigns the correct duration to the encode" do
expect(create_without_metadata_job.input.duration).to eq 68_653
expect(find_without_metadata_job.input.duration).to eq 68_653
expect(create_without_metadata_job.input.duration).to eq 4_640
expect(find_without_metadata_job.input.duration).to eq 4_640
end
end
end
Expand Down Expand Up @@ -246,8 +246,8 @@ def touch_fixture(id, filename)
let(:file_with_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', 'file.with :=+%sp3c!l-ch4cts().mp4').to_s }
let!(:create_special_characters_job) { ActiveEncode::Base.create(file_with_special_characters, outputs: [{ label: "low", url: file_with_special_characters_derivative }]) }
let(:find_special_characters_job) { ActiveEncode::Base.find create_special_characters_job.id }
let(:file_with_more_special_characters) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s }
let(:file_with_more_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s }
let(:file_with_more_special_characters) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s }
let(:file_with_more_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s }
let!(:create_more_special_characters_job) { ActiveEncode::Base.create(file_with_more_special_characters, outputs: [{ label: "low", url: file_with_more_special_characters_derivative }]) }
let(:find_more_special_characters_job) { ActiveEncode::Base.find create_more_special_characters_job.id }

Expand All @@ -264,8 +264,8 @@ def touch_fixture(id, filename)
context 'when uri encoded' do
let(:file_with_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', 'file.with :=+%sp3c!l-ch4cts().mp4').to_s) }
let(:file_with_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', 'file.with :=+%sp3c!l-ch4cts().mp4').to_s }
let(:file_with_more_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s) }
let(:file_with_more_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s }
let(:file_with_more_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s) }
let(:file_with_more_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s }

it "does not have errors" do
expect(find_special_characters_job.errors).to be_empty
Expand Down

0 comments on commit f35a797

Please sign in to comment.