Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Tests (#719)
Browse files Browse the repository at this point in the history
* computer switch

* some fixes; github action

* added pr to master

* sqlx database setup

* switched intial GHA test db

* removed sqlx database setup

* unfinished patch route

* bug fixes + tests

* more tests, more fixes, cargo fmt

* merge fixes

* more tests, full reorganization

* fmt, clippy

* sqlx-data

* revs

* removed comments

* delete revs
  • Loading branch information
thesuzerain authored Oct 6, 2023
1 parent a1b59d4 commit 259c5ef
Show file tree
Hide file tree
Showing 69 changed files with 4,165 additions and 1,310 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches: [master]
pull_request:
branches:
- master

env:
CARGO_TERM_COLOR: always
Expand All @@ -21,23 +23,34 @@ jobs:

steps:
- uses: actions/checkout@v2

# Start Docker Compose
- name: Start Docker Compose
run: docker-compose up -d

- uses: actions-rs/toolchain@v1
name: Install toolchain
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Cache build artifacts
id: cache-build

# Cache dependencies and build artifacts
- name: Cache build artifacts and dependencies
uses: actions/cache@v2
with:
path: target/**
key: ${{ runner.os }}-build-cache-${{ matrix.rust }}
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: actions-rs/cargo@v1
with:
command: build
env:
SQLX_OFFLINE: true

- uses: actions-rs/cargo@v1
with:
command: test
Expand All @@ -50,4 +63,5 @@ jobs:
S3_URL: ${{ secrets.S3_URL }}
S3_REGION: ${{ secrets.S3_REGION }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}
SQLX_OFFLINE: true
SQLX_OFFLINE: true
DATABASE_URL: postgresql://labrinth:labrinth@localhost/postgres
13 changes: 7 additions & 6 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,7 @@ color-thief = "0.2.2"

woothee = "0.13.0"

lettre = "0.10.4"
lettre = "0.10.4"

[dev-dependencies]
actix-http = "3.4.0"
68 changes: 34 additions & 34 deletions sqlx-data.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
{
"db": "PostgreSQL",
"009bce5eee6ed65d9dc0899a4e24da528507a3f00b7ec997fa9ccdd7599655b1": {
"describe": {
"columns": [
{
"name": "id",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int8",
"Text"
]
}
},
"query": "\n SELECT m.id FROM organizations o\n INNER JOIN mods m ON m.organization_id = o.id\n WHERE (o.id = $1 AND $1 IS NOT NULL) OR (o.title = $2 AND $2 IS NOT NULL)\n "
},
"010cafcafb6adc25b00e3c81d844736b0245e752a90334c58209d8a02536c800": {
"describe": {
"columns": [],
Expand Down Expand Up @@ -3669,6 +3690,19 @@
},
"query": "\n SELECT n.id FROM notifications n\n WHERE n.user_id = $1\n "
},
"7b6b76f383adcbe2afbd2a2e87e66fd2a0d9d05b68b27823c1395e7cc3b8c0a2": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Varchar",
"Int8"
]
}
},
"query": "\n UPDATE collections\n SET status = $1\n WHERE (id = $2)\n "
},
"7c0cdacf0898155c94008a96a0b918550df4475b9e3362a926d4d00e001880c1": {
"describe": {
"columns": [
Expand Down Expand Up @@ -3821,19 +3855,6 @@
},
"query": "\n SELECT name FROM side_types\n "
},
"86049f204c9eda5241403d22b5f8ffe13b258ddfffb81a1a9ee8602e21c64723": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Varchar",
"Int8"
]
}
},
"query": "\n UPDATE collections\n SET status = $1\n WHERE (id = $2)\n "
},
"868ee76d507cc9e94cd3c2e44770faff127e2b3c5f49b8100a9a37ac4d7b1f1d": {
"describe": {
"columns": [],
Expand Down Expand Up @@ -6131,27 +6152,6 @@
},
"query": "\n UPDATE versions\n SET featured = $1\n WHERE (id = $2)\n "
},
"e60561aeefbc2bed1f77ff4bbca763b5be84bd6bc3eff75ca57e3590be286d45": {
"describe": {
"columns": [
{
"name": "id",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int8",
"Text"
]
}
},
"query": "\n SELECT m.id FROM organizations o\n LEFT JOIN mods m ON m.id = o.id\n WHERE (o.id = $1 AND $1 IS NOT NULL) OR (o.title = $2 AND $2 IS NOT NULL)\n "
},
"e60ea75112db37d3e73812e21b1907716e4762e06aa883af878e3be82e3f87d3": {
"describe": {
"columns": [
Expand Down
Loading

0 comments on commit 259c5ef

Please sign in to comment.