Skip to content

Commit eb56b9f

Browse files
authored
fix(ci): run entire snapshot in main, pr and main-cron workflows (#8523)
1 parent d06674b commit eb56b9f

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

ci/scripts/deterministic-e2e-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ echo "--- deterministic simulation e2e, ci-3cn-2fe, parallel, batch"
4545
seq $TEST_NUM | parallel MADSIM_TEST_SEED={} './risingwave_simulation -j 16 ./e2e_test/batch/\*\*/\*.slt 2> $LOGDIR/parallel-batch-{}.log && rm $LOGDIR/parallel-batch-{}.log'
4646

4747
echo "--- deterministic simulation e2e, ci-3cn-2fe, fuzzing (pre-generated-queries)"
48-
seq $TEST_NUM | parallel MADSIM_TEST_SEED={} './risingwave_simulation --run-sqlsmith-queries ./src/tests/sqlsmith/tests/sqlsmith-query-snapshots/{} 2> $LOGDIR/fuzzing-{}.log && rm $LOGDIR/fuzzing-{}.log'
48+
seq 64 | parallel MADSIM_TEST_SEED={} './risingwave_simulation --run-sqlsmith-queries ./src/tests/sqlsmith/tests/sqlsmith-query-snapshots/{} 2> $LOGDIR/fuzzing-{}.log && rm $LOGDIR/fuzzing-{}.log'

ci/workflows/pull-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ steps:
228228
- ./ci/plugins/upload-failure-logs
229229
timeout_in_minutes: 15
230230
retry: *auto-retry
231+
soft_fail: true
231232

232233
- label: "check"
233234
command: "ci/scripts/check.sh"

src/tests/sqlsmith/scripts/gen_queries.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,25 @@ check_failed_to_generate_queries() {
142142
fi
143143
}
144144

145+
# sync step
146+
# Some queries maybe be added
147+
sync_queries() {
148+
set +x
149+
pushd $OUTDIR
150+
git checkout main
151+
git pull
152+
set +e
153+
git branch -D stage
154+
set -e
155+
git checkout -b stage
156+
popd
157+
set -x
158+
}
159+
145160
# Upload step
146161
upload_queries() {
147162
set +x
148163
pushd "$OUTDIR"
149-
git checkout -b stage
150164
git add .
151165
git commit -m 'update queries'
152166
git push -f origin stage
@@ -209,6 +223,11 @@ validate() {
209223
echo_err "[INFO] Passed checks"
210224
}
211225

226+
sync() {
227+
sync_queries
228+
echo_err "[INFO] Synced"
229+
}
230+
212231
upload() {
213232
upload_queries
214233
echo_err "[INFO] Uploaded"
@@ -223,6 +242,7 @@ main() {
223242
setup
224243

225244
build
245+
sync
226246
generate
227247
validate
228248
upload

src/tests/sqlsmith/src/sql_gen/scalar.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,19 @@ impl<'a, R: Rng> SqlGenerator<'a, R> {
148148
fn gen_temporal_scalar(&mut self, typ: &DataType) -> String {
149149
use DataType as T;
150150

151-
let rand_secs = self.rng.gen_range(2..1000000) as u64;
152151
let minute = 60;
153152
let hour = 60 * minute;
154153
let day = 24 * hour;
155154
let week = 7 * day;
156-
let choices = [0, 1, minute, hour, day, week, rand_secs];
157-
let secs = choices.choose(&mut self.rng).unwrap();
155+
let choices = [0, 1, minute, hour, day, week];
158156

159-
let tm = DateTime::<Utc>::from(SystemTime::now() - Duration::from_secs(*secs));
157+
let secs = match self.rng.gen_range(1..=100) {
158+
1..=30 => *choices.choose(&mut self.rng).unwrap(),
159+
31..=100 => self.rng.gen_range(2..100) as u64,
160+
_ => unreachable!(),
161+
};
162+
163+
let tm = DateTime::<Utc>::from(SystemTime::now() - Duration::from_secs(secs));
160164
match typ {
161165
T::Date => tm.format("%F").to_string(),
162166
T::Timestamp | T::Timestamptz => tm.format("%Y-%m-%d %H:%M:%S").to_string(),
@@ -169,7 +173,7 @@ impl<'a, R: Rng> SqlGenerator<'a, R> {
169173
T::Time => tm.format("%T").to_string(),
170174
T::Interval => {
171175
if self.rng.gen_bool(0.5) {
172-
(-(*secs as i64)).to_string()
176+
(-(secs as i64)).to_string()
173177
} else {
174178
secs.to_string()
175179
}

0 commit comments

Comments
 (0)