This commit is contained in:
14
.gitea/workflows/test.yaml
Normal file
14
.gitea/workflows/test.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
name: test
|
||||||
|
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
- run: rustup update stable && rustup default stable
|
||||||
|
- run: cargo build --release --verbose
|
||||||
|
- run: cargo test --release --verbose
|
||||||
@@ -89,7 +89,6 @@ mod tests {
|
|||||||
let host = container.get_host().await?;
|
let host = container.get_host().await?;
|
||||||
let port = container.get_host_port_ipv4(1433).await?;
|
let port = container.get_host_port_ipv4(1433).await?;
|
||||||
let connection_string = format!("jdbc:sqlserver://{}:{};username=sa;password=TestOnlyContainer123", host, port).to_owned();
|
let connection_string = format!("jdbc:sqlserver://{}:{};username=sa;password=TestOnlyContainer123", host, port).to_owned();
|
||||||
let connection_string = "jdbc:sqlserver://localhost:1433;username=sa;password=TestOnlyContainer123;Encrypt=False".to_owned();
|
|
||||||
|
|
||||||
let runner = PullFromDBNodeRunner {
|
let runner = PullFromDBNodeRunner {
|
||||||
pull_from_db_node: PullFromDBNode {
|
pull_from_db_node: PullFromDBNode {
|
||||||
|
|||||||
@@ -138,3 +138,26 @@ impl RunnableNode for UploadNodeRunner {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use crate::graph::upload_to_db::{DBType, UploadNode, UploadNodeRunner};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn check_basic_upload() {
|
||||||
|
let upload_ode = UploadNodeRunner {
|
||||||
|
upload_node: UploadNode {
|
||||||
|
file_path: "".to_owned(),
|
||||||
|
table_name: "".to_string(),
|
||||||
|
column_mappings: None,
|
||||||
|
post_script: None,
|
||||||
|
db_type: DBType::Mysql,
|
||||||
|
connection_string: "".to_string(),
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn check_batch_upload() {}
|
||||||
|
}
|
||||||
|
|||||||
@@ -425,14 +425,14 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn move_money() {
|
fn move_money() {
|
||||||
super::move_money(
|
super::move_money(
|
||||||
&mut csv::Reader::from_path("reclassrule.csv").unwrap(),
|
&mut csv::Reader::from_path("testing/input/move_money/reclassrule.csv").unwrap(),
|
||||||
&mut csv::Reader::from_path("line.csv").unwrap(),
|
&mut csv::Reader::from_path("testing/input/move_money/line.csv").unwrap(),
|
||||||
&mut csv::Reader::from_path("account.csv").unwrap(),
|
&mut csv::Reader::from_path("testing/input/account.csv").unwrap(),
|
||||||
&mut csv::Reader::from_path("costcentres.csv").unwrap(),
|
&mut csv::Reader::from_path("testing/input/costcentre.csv").unwrap(),
|
||||||
&mut csv::Writer::from_path("output.csv").unwrap(),
|
&mut csv::Writer::from_path("testing/output/output.csv").unwrap(),
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.expect("Failed to move money");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_read_definitions() {
|
fn test_read_definitions() {
|
||||||
let definitions = read_definitions(
|
let definitions = read_definitions(
|
||||||
&mut csv::Reader::from_path("service_builder_definitions.csv").unwrap(),
|
&mut csv::Reader::from_path("testing/input/create_products/service_builder_definitions.csv").unwrap(),
|
||||||
);
|
);
|
||||||
if let Err(error) = &definitions {
|
if let Err(error) = &definitions {
|
||||||
println!("{}", error)
|
println!("{}", error)
|
||||||
|
|||||||
Reference in New Issue
Block a user