advanced pipeline
This commit is contained in:
@@ -15,7 +15,7 @@ RSpec.describe WarpEngine::CI::Gitlab::Client do
|
||||
|
||||
describe "repos" do
|
||||
it "lists repos" do
|
||||
repos = [{ "id" => 1, "path" => "game1" }]
|
||||
repos = [ { "id" => 1, "path" => "game1" } ]
|
||||
stub_gl(:get, "/api/v4/projects?membership=true&per_page=100&simple=true", body: repos)
|
||||
|
||||
expect(client.list_repos).to eq(repos)
|
||||
@@ -39,7 +39,7 @@ RSpec.describe WarpEngine::CI::Gitlab::Client do
|
||||
|
||||
describe "secrets (variables)" do
|
||||
it "lists variables" do
|
||||
vars = [{ "key" => "application_token" }]
|
||||
vars = [ { "key" => "application_token" } ]
|
||||
stub_gl(:get, "/api/v4/projects/1/variables", body: vars)
|
||||
|
||||
expect(client.list_secrets(1)).to eq(vars)
|
||||
@@ -68,7 +68,7 @@ RSpec.describe WarpEngine::CI::Gitlab::Client do
|
||||
|
||||
describe "pipelines" do
|
||||
it "lists pipelines" do
|
||||
pipelines = [{ "id" => 1, "status" => "success" }]
|
||||
pipelines = [ { "id" => 1, "status" => "success" } ]
|
||||
stub_gl(:get, "/api/v4/projects/42/pipelines?page=1&per_page=25", body: pipelines)
|
||||
|
||||
expect(client.list_pipelines(42)).to eq(pipelines)
|
||||
@@ -76,7 +76,7 @@ RSpec.describe WarpEngine::CI::Gitlab::Client do
|
||||
|
||||
it "gets latest pipeline" do
|
||||
pipeline = { "id" => 5, "status" => "running" }
|
||||
stub_gl(:get, "/api/v4/projects/42/pipelines?per_page=1&sort=desc", body: [pipeline])
|
||||
stub_gl(:get, "/api/v4/projects/42/pipelines?per_page=1&sort=desc", body: [ pipeline ])
|
||||
|
||||
expect(client.latest_pipeline(42)).to eq(pipeline)
|
||||
end
|
||||
|
||||
@@ -15,7 +15,7 @@ RSpec.describe WarpEngine::CI::Woodpecker::Client do
|
||||
|
||||
describe "repos" do
|
||||
it "lists repos" do
|
||||
repos = [{ "id" => 1, "name" => "game1" }]
|
||||
repos = [ { "id" => 1, "name" => "game1" } ]
|
||||
stub_wp(:get, "/api/repos", body: repos)
|
||||
|
||||
expect(client.list_repos).to eq(repos)
|
||||
@@ -37,7 +37,7 @@ RSpec.describe WarpEngine::CI::Woodpecker::Client do
|
||||
|
||||
describe "secrets" do
|
||||
it "lists secrets" do
|
||||
secrets = [{ "name" => "application_token" }]
|
||||
secrets = [ { "name" => "application_token" } ]
|
||||
stub_wp(:get, "/api/repos/1/secrets", body: secrets)
|
||||
|
||||
expect(client.list_secrets(1)).to eq(secrets)
|
||||
@@ -66,7 +66,7 @@ RSpec.describe WarpEngine::CI::Woodpecker::Client do
|
||||
|
||||
describe "pipelines" do
|
||||
it "lists pipelines" do
|
||||
pipelines = [{ "number" => 1, "status" => "success" }]
|
||||
pipelines = [ { "number" => 1, "status" => "success" } ]
|
||||
stub_wp(:get, "/api/repos/42/pipelines?page=1&perPage=25", body: pipelines)
|
||||
|
||||
expect(client.list_pipelines(42)).to eq(pipelines)
|
||||
|
||||
@@ -20,12 +20,13 @@ RSpec.describe WarpEngine::PlatformLink, type: :model do
|
||||
end
|
||||
end
|
||||
|
||||
describe "default scope" do
|
||||
it "excludes soft-deleted records" do
|
||||
active = create(:platform_link)
|
||||
create(:platform_link, deleted_at: Time.current)
|
||||
describe "scopes" do
|
||||
it "keeps soft-deleted records out of .kept, not out of .all" do
|
||||
active = create(:platform_link)
|
||||
deleted = create(:platform_link, deleted_at: Time.current)
|
||||
|
||||
expect(WarpEngine::PlatformLink.all).to eq([active])
|
||||
expect(WarpEngine::PlatformLink.kept).to eq([ active ])
|
||||
expect(WarpEngine::PlatformLink.all).to contain_exactly(active, deleted)
|
||||
end
|
||||
|
||||
it "does not order: ordering is asked for, not inherited" do
|
||||
@@ -52,7 +53,7 @@ RSpec.describe WarpEngine::PlatformLink, type: :model do
|
||||
create(:platform_link, platform: "love")
|
||||
|
||||
result = WarpEngine::PlatformLink.for_platform("tic80")
|
||||
expect(result).to eq([tic80_link])
|
||||
expect(result).to eq([ tic80_link ])
|
||||
end
|
||||
|
||||
it "returns empty array for platform without links" do
|
||||
|
||||
@@ -18,7 +18,7 @@ RSpec.describe WarpEngine::Software, type: :model do
|
||||
active = create(:software)
|
||||
create(:software, deleted_at: Time.current)
|
||||
|
||||
expect(WarpEngine::Software.kept).to eq([active])
|
||||
expect(WarpEngine::Software.kept).to eq([ active ])
|
||||
end
|
||||
|
||||
it "includes soft-deleted records without scope" do
|
||||
|
||||
@@ -11,7 +11,7 @@ RSpec.describe WarpEngine::BuildsService do
|
||||
end
|
||||
|
||||
it "returns c64 with only cartridge" do
|
||||
expect(result[:platforms]["c64"][:kinds]).to eq(["cartridge"])
|
||||
expect(result[:platforms]["c64"][:kinds]).to eq([ "cartridge" ])
|
||||
end
|
||||
|
||||
it "returns allKinds matching WarpEngine::ReleaseAsset::KINDS" do
|
||||
|
||||
Reference in New Issue
Block a user