Skip to content
Snippets Groups Projects
Commit a26ee804 authored by Shinya Maeda's avatar Shinya Maeda
Browse files

missing the public folder is InvaildStateError

parent b4d9d4db
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -31,7 +31,7 @@ module Projects
 
# Check if we did extract public directory
archive_public_path = File.join(archive_path, 'public')
raise FailedToExtractError, 'pages miss the public folder' unless Dir.exist?(archive_public_path)
raise InvaildStateError, 'pages miss the public folder' unless Dir.exist?(archive_public_path)
raise InvaildStateError, 'pages are outdated' unless latest?
 
deploy_page!(archive_public_path)
Loading
Loading
@@ -41,6 +41,7 @@ module Projects
error(e.message)
rescue => e
error(e.message, false)
raise e
end
 
private
Loading
Loading
Loading
Loading
@@ -87,7 +87,8 @@ describe Projects::UpdatePagesService do
it 'fails for empty file fails' do
build.update_attributes(legacy_artifacts_file: empty_file)
 
expect(execute).not_to eq(:success)
expect { execute }
.to raise_error(Projects::UpdatePagesService::FailedToExtractError)
end
end
end
Loading
Loading
@@ -159,7 +160,8 @@ describe Projects::UpdatePagesService do
it 'fails for empty file fails' do
build.job_artifacts_archive.update_attributes(file: empty_file)
 
expect(execute).not_to eq(:success)
expect { execute }
.to raise_error(Projects::UpdatePagesService::FailedToExtractError)
end
 
context 'when timeout happens by DNS error' do
Loading
Loading
@@ -169,7 +171,7 @@ describe Projects::UpdatePagesService do
end
 
it 'raises an error' do
execute
expect { execute }.to raise_error(SocketError)
 
build.reload
expect(deploy_status).to be_failed
Loading
Loading
@@ -185,7 +187,8 @@ describe Projects::UpdatePagesService do
end
 
it 'raises an error' do
execute
expect { execute }
.to raise_error(Projects::UpdatePagesService::FailedToExtractError)
 
build.reload
expect(deploy_status).to be_failed
Loading
Loading
@@ -198,7 +201,7 @@ describe Projects::UpdatePagesService do
allow(build).to receive(:artifacts_metadata?).and_return(false)
end
 
it 'raises an error' do
it 'does not raise an error and remove artifacts as failed job' do
execute
 
build.reload
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment