Closed hbina closed 3 years ago
Can someone figure out a way to generate the seed here?
synth/examples/random_variants on hbina-ISSUE-149-utilize-weights-in-oneof [?] on ☁️ (ap-southeast-1)
❯ cargo run --bin synth -- generate random --size 1 --seed $(od -vAn -N2 -tu2 < /dev/urandom) | jq | rg '1' | wc -l
warning: /home/hbina/git/synth/synth/Cargo.toml: unused manifest key: target.i686-pc-windows-msvc.rustflags
warning: /home/hbina/git/synth/synth/Cargo.toml: unused manifest key: target.x86_64-pc-windows-msvc.rustflags
Finished dev [unoptimized + debuginfo] target(s) in 0.12s
Running `/home/hbina/git/synth/target/debug/synth generate random --size 1 --seed ' 57622'`
error: Invalid value for '--seed <seed>': invalid digit found in string
0
Can someone figure out a way to generate the seed here?
I can think of two ways:
synth generate --random
flag which will randomize the seed for you.$RANDOM
which I believe at least works for bash:
cargo run --bin synth -- generate examples/bank/bank_db/ --size 1 --seed $RANDOM
@brokad is there an automated way to generate the SQL script for the test harnesses?
@brokad is there an automated way to generate the SQL script for the test harnesses?
Unfortunately there isn't. Pinging @fretz12, who wrote all those tests: do you have local scripts you can share for this maybe?
@brokad @hbina -
I assume you're referring to 0_hospital_schema.sql
and 1_hospital_data.sql
. FYI those scripts were already there when i came in. I did copy them over for mysql test harness and had to modify them slightly to suit mysql.
Sorry couldn't be of more help.
Hmm - I think there is a new clippy lint out. I'll take a look.
swap_remove
which have O(1) since we don't care about the order.Small demo
Closes https://github.com/getsynth/synth/issues/149