Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ The commands CI runs, in `.github/workflows/rust.yml`:
- [ ] `cargo clippy --workspace --all-targets --all-features -- -D warnings`
- [ ] `cargo test -p lyracore-importer`
- [ ] `cargo test -p lyracore-module --lib --features=debug_reducers`
- [ ] `cargo test -p lyracore-module --test package_api_lint`
- [ ] `cargo test -p lyracore-package-delta`
- [ ] `cargo test -p lyracore-gateway`
- [ ] `cargo test -p lyracore-shared`
- [ ] `cargo test -p lyracore-test-support`
Expand All @@ -34,7 +36,7 @@ In `.github/workflows/module-durable.yml`, when the change reaches the Module or

In `.github/workflows/runtime-scripts.yml`, when the change reaches `datascripts/`:

- [ ] `bun test tests/runtime-scripts.test.ts` in `datascripts/`
- [ ] `bun test` in `datascripts/`

Other checks:

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/runtime-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
with:
bun-version: 1.3.7
- run: bun install --frozen-lockfile
- name: Typecheck and verify Runtime Script output
run: bun test tests/runtime-scripts.test.ts
- name: Test Datascripts and compile Runtime Scripts
run: bun test
4 changes: 3 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
# One job, not four: the crates share a target directory, and a failed step names its crate.
# Share compiled dependencies while keeping each crate's result separate.
- run: cargo test -p lyracore-importer
- run: cargo test -p lyracore-module --lib --features=debug_reducers
- run: cargo test -p lyracore-module --test package_api_lint
- run: cargo test -p lyracore-package-delta
- run: cargo test -p lyracore-gateway
- run: cargo test -p lyracore-shared
- run: cargo test -p lyracore-test-support
Expand Down
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/lyracore-package-delta/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ pub const WHOLE_QUEST_ROW: &str = r#"{
"repeatable": { "type": "bool", "value": false },
"next_quest_id": { "type": "u32", "value": 0 },
"limit_time": { "type": "u32", "value": 0 },
"reward_money_max_level": { "type": "u32", "value": 0 }
"reward_money_max_level": { "type": "u32", "value": 0 },
"quest_type": { "type": "u32", "value": 0 }
}"#;

/// One `game_quest_template` claim.
Expand Down
17 changes: 12 additions & 5 deletions crates/lyracore-package-delta/tests/quest_identifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,24 @@ fn the_package_range_is_disjoint_from_every_reserved_identifier() {

#[test]
fn an_incomplete_quest_insert_is_refused() {
let mut fields: serde_json::Map<String, serde_json::Value> =
serde_json::from_str(WHOLE_QUEST_ROW).unwrap();
fields.remove("reward_money");
fields.remove("quest_type");
let json = artifact(
"example.pkg",
&quest_claim(PACKAGE_QUEST_ID_FLOOR, "insert", A_TITLE),
&quest_claim(
PACKAGE_QUEST_ID_FLOOR,
"insert",
&serde_json::to_string(&fields).unwrap(),
),
);

match PackageDelta::parse(&json).expect_err("the insert must be refused") {
DeltaError::IncompleteInsert { table, missing } => {
DeltaError::IncompleteInsert { table, mut missing } => {
assert_eq!(table, Table::Quest);
assert_eq!(missing.len(), 18);
assert!(missing.contains(&"reward_money".to_owned()));
assert!(!missing.contains(&"title".to_owned()));
missing.sort();
assert_eq!(missing, ["quest_type", "reward_money"]);
}
other => panic!("expected an incomplete insert, got {other}"),
}
Expand Down
1 change: 1 addition & 0 deletions crates/lyracore-test-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ publish.workspace = true
description = "Private Standalone fixtures shared by Core and Package integration tests."

[dependencies]
rustc_lexer = "0.1.0"
serde_json = "1"

[lints]
Expand Down
Loading
Loading