Skip to content

Commit

Permalink
Merge branch 'main' into calendar-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm authored Jul 20, 2024
2 parents 3b54e5c + 9d1b65e commit 679b157
Show file tree
Hide file tree
Showing 106 changed files with 5,005 additions and 488 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9.1.3
version: 9.5.0
package_json_file: webclient/package.json
run_install: |
- cwd: webclient
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/server-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- run: cargo test --workspace
- name: Setup | install insta
run: curl -LsSf https://insta.rs/install.sh | sh
- run: cargo insta test --workspace
working-directory: server
linting:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/webclient-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9.1.3
version: 9.5.0
package_json_file: webclient/package.json
run_install: |
- cwd: webclient
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ data/sources/15_patches-rooms_tumonline.yaml
data/sources/45_custom-maps.yaml
data/sources/46_overlay-maps.yaml
data/sources/img/img-sources.yaml
server/main-api/test/test-queries.yaml
deployment/k3s
2 changes: 1 addition & 1 deletion data/processors/tumonline.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def _maybe_set_alt_name(room_code: str, arch_name_parts: tuple[str, str], room:
if len(alt_parts) < 2:
return
if alt_parts[0].lower() == arch_name_parts[0].lower():
room.alt_name = ", ".join(alt_parts[1:])
room.alt_name = ", ".join(alt_parts[1:]).strip()
return
# The most common mismatch is if the roomname in the alt_name is like "L516" and the arch_name starts with "L 516".
# In this case we change the arch_name to the format without a space
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mypy==1.11.0
pre-commit==3.7.1
pytest==8.2.2
pytest==8.3.1
ruff==0.5.3
types-Pillow==10.2.0.20240520
types-PyYAML==6.0.12.20240311
Expand Down
107 changes: 104 additions & 3 deletions server/Cargo.lock

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

5 changes: 5 additions & 0 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ opt-level = 3
# https://github.com/launchbadge/sqlx?tab=readme-ov-file#compile-time-verification
[profile.dev.package.sqlx-macros]
opt-level = 3

# https://insta.rs/docs/quickstart/
[profile.dev.package]
insta.opt-level = 3
similar.opt-level = 3
3 changes: 2 additions & 1 deletion server/main-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ actix-web = { version = "4.5.1", default-features = false, features = ["macros",
actix-cors = "0.7.0"
rustls = { version = "0.23.5", default-features = false, features = ["ring"] } # the aws' fips complient libary has weird bingen issues which require deeper looking into

cached = { version = "0.52.0", features = ["default", "async", "tokio", "disk_store"] }
cached = { version = "0.53.0", features = ["default", "async", "tokio", "disk_store"] }
futures = "0.3.30"
# temporarily forked until https://github.com/Aetf/unicode-truncate/issues/16 is resolved
unicode-truncate = { git = "https://github.com/CommanderStorm/unicode-truncate.git", rev = "5cc7798" }
Expand Down Expand Up @@ -73,6 +73,7 @@ base64 = "0.22.1"
time = "0.3.36"

[dev-dependencies]
insta = { version = "1.39.0", features = ["yaml", "json", "redactions"] }
pretty_assertions = "1.4.0"
testcontainers = { version = "0.20.0", features = ["watchdog"] }
testcontainers-modules = { version = "0.8.0", features = ["postgres", "meilisearch"] }
Expand Down
9 changes: 9 additions & 0 deletions server/main-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ some fuzzing-goals are automatically tested in our CI.
You can exchange `--base-url=http://localhost:3003` to `--base-url=https://nav.tum.de` for the full public API, or
restrict your scope using an option like `--endpoint=/api/search`.

### Approval tests

Some of our tests are approval tests.
Please install [insta](https://insta.rs/docs/quickstart/) to have a working environment.

You can then run `cargo insta test` instead of `cargo test` to review the needed changes.
If you don't want to do this, using the version we provide via CI is fine, but the DX is way better with the correct
tooling.

## License

This program is free software: you can redistribute it and/or modify
Expand Down
Loading

0 comments on commit 679b157

Please sign in to comment.