Skip to content
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
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ updates:
dependency-type: indirect
- dependency-name: require_all
dependency-type: indirect
- dependency-name: uuid
dependency-type: indirect
- package-ecosystem: bundler
directory: /allure-rspec
schedule:
Expand Down
1 change: 0 additions & 1 deletion allure-ruby-commons/allure-ruby-commons.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ Gem::Specification.new do |s|
s.add_dependency "mime-types", ">= 3.3", "< 4"
s.add_dependency "require_all", ">= 2", "< 4"
s.add_dependency "rspec-expectations", "~> 3.12"
s.add_dependency "uuid", ">= 2.3", "< 3"
end
2 changes: 1 addition & 1 deletion allure-ruby-commons/lib/allure-ruby-commons.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# frozen_string_literal: true

require "require_all"
require "uuid"
require "securerandom"

require_rel "allure_ruby_commons/**/*rb"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestResult < ExecutableItem
# @option options [Array<Allure::Link>] :links ([])
# @option options [Array<Allure::Attachment>] :attachments ([])
# @option options [Array<Allure::Parameter>] :parameters ([])
def initialize(uuid: UUID.generate, history_id: UUID.generate, environment: nil, **options)
def initialize(uuid: SecureRandom.uuid, history_id: SecureRandom.uuid, environment: nil, **options)
super

@name = options[:name]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Allure
# Allure model step result container
class TestResultContainer < JSONable
def initialize(uuid: UUID.generate, name: "Unnamed")
def initialize(uuid: SecureRandom.uuid, name: "Unnamed")
super()

@uuid = uuid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def status_details(exception)
# @return [Allure::Attachment]
def prepare_attachment(name, type)
extension = ContentType.to_extension(type) || return
file_name = "#{UUID.generate}-attachment.#{extension}"
file_name = "#{SecureRandom.uuid}-attachment.#{extension}"
Attachment.new(name: name, source: file_name, type: type)
end

Expand Down
4 changes: 2 additions & 2 deletions allure-ruby-commons/spec/unit/file_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
attachment = Allure::Attachment.new(
name: "Test attachment",
type: Allure::ContentType::TXT,
source: "#{UUID.generate}-attachment.txt"
source: "#{SecureRandom.uuid}-attachment.txt"
)
attachment_file = File.join(results_dir, attachment.source)
file_writer.write_attachment("Test attachment", attachment)
Expand All @@ -41,7 +41,7 @@
attachment = Allure::Attachment.new(
name: "Test attachment",
type: Allure::ContentType::PNG,
source: "#{UUID.generate}-attachment.png"
source: "#{SecureRandom.uuid}-attachment.png"
)
source = File.new(File.join(Dir.pwd, "spec", "fixtures", "ruby-logo.png"))
attachment_file = File.join(results_dir, attachment.source)
Expand Down