Skip to content

Commit 1efa923

Browse files
authored
Make dev OCI tests required (#754)
This changeset make the dev environment OCI conformance tests required.
1 parent 22baa89 commit 1efa923

2 files changed

Lines changed: 27 additions & 12 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,6 @@ jobs:
9090
env:
9191
RUST_BACKTRACE: full
9292
run: cargo test-api smoke dev
93-
- name: Run OCI Conformance Test
94-
continue-on-error: true
95-
timeout-minutes: 5
96-
run: |
97-
cargo test-api oci \
98-
--url https://dev.registry.bencher.dev/
9993
- name: OCI Conformance Test Summary
10094
if: always()
10195
run: |

tasks/test_api/src/task/test/smoke_test.rs

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ use std::{
77
};
88

99
use bencher_json::{
10-
BENCHER_API_PORT, DEV_BENCHER_API_URL, JsonApiVersion, Jwt, LOCALHOST_BENCHER_API_URL,
11-
PROD_BENCHER_API_URL, TEST_BENCHER_API_URL, Url,
10+
BENCHER_API_PORT, DEV_BENCHER_API_URL, DEV_BENCHER_REGISTRY_URL, JsonApiVersion, Jwt,
11+
LOCALHOST_BENCHER_API_URL, LOCALHOST_BENCHER_REGISTRY_URL, PROD_BENCHER_API_URL,
12+
PROD_BENCHER_REGISTRY_URL, TEST_BENCHER_API_URL, TEST_BENCHER_REGISTRY_URL, Url,
1213
};
1314

1415
use crate::{
@@ -82,12 +83,14 @@ impl SmokeTest {
8283
};
8384

8485
let api_url = self.environment.as_url();
86+
let registry_url = self.environment.as_registry_url();
8587
test_api_version(&api_url)?;
8688

8789
match self.environment {
8890
Environment::Ci => {
8991
test(
9092
&api_url,
93+
&registry_url,
9194
MockSetup::SelfHosted {
9295
examples: false,
9396
runner: true,
@@ -98,6 +101,7 @@ impl SmokeTest {
98101
Environment::Localhost => {
99102
test(
100103
&api_url,
104+
&registry_url,
101105
MockSetup::SelfHosted {
102106
examples: true,
103107
runner: false,
@@ -106,7 +110,7 @@ impl SmokeTest {
106110
kill_child(child)?;
107111
},
108112
Environment::Docker => bencher_down()?,
109-
Environment::Dev => test(&api_url, MockSetup::BencherCloud)?,
113+
Environment::Dev => test(&api_url, &registry_url, MockSetup::BencherCloud)?,
110114
Environment::Test | Environment::Prod => {},
111115
}
112116

@@ -124,6 +128,16 @@ impl Environment {
124128
}
125129
.into()
126130
}
131+
132+
fn as_registry_url(self) -> Url {
133+
match self {
134+
Self::Ci | Self::Localhost | Self::Docker => LOCALHOST_BENCHER_REGISTRY_URL.clone(),
135+
Self::Dev => DEV_BENCHER_REGISTRY_URL.clone(),
136+
Self::Test => TEST_BENCHER_REGISTRY_URL.clone(),
137+
Self::Prod => PROD_BENCHER_REGISTRY_URL.clone(),
138+
}
139+
.into()
140+
}
127141
}
128142

129143
fn api_run() -> anyhow::Result<Child> {
@@ -205,7 +219,7 @@ enum MockSetup {
205219
SelfHosted { examples: bool, runner: bool },
206220
}
207221

208-
fn test(api_url: &Url, mock_setup: MockSetup) -> anyhow::Result<()> {
222+
fn test(api_url: &Url, registry_url: &Url, mock_setup: MockSetup) -> anyhow::Result<()> {
209223
match mock_setup {
210224
MockSetup::BencherCloud => {
211225
let task = TaskSeedTest {
@@ -215,9 +229,16 @@ fn test(api_url: &Url, mock_setup: MockSetup) -> anyhow::Result<()> {
215229
};
216230
SeedTest::try_from(task)?.exec()?;
217231

218-
// Run runner smoke test (requires Docker + KVM for the runner daemon)
219232
#[cfg(feature = "plus")]
220233
{
234+
// Run OCI conformance tests
235+
let oci = Oci::try_from(TaskOci {
236+
url: Some(registry_url.clone()),
237+
..Default::default()
238+
})?;
239+
oci.exec()?;
240+
241+
// Run runner smoke test (requires Docker + KVM for the runner daemon)
221242
let runner_test = runner::RunnerTest::try_from(TaskRunner {
222243
url: Some(api_url.clone()),
223244
with_daemon: true,
@@ -239,7 +260,7 @@ fn test(api_url: &Url, mock_setup: MockSetup) -> anyhow::Result<()> {
239260
{
240261
// Run OCI conformance tests
241262
let oci = Oci::try_from(TaskOci {
242-
url: Some(api_url.clone()),
263+
url: Some(registry_url.clone()),
243264
..Default::default()
244265
})?;
245266
oci.exec()?;

0 commit comments

Comments
 (0)