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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
NODE_VERSION: 23.3.0

# Latest Rust version: https://www.rust-lang.org/
RUST_VERSION: 1.82.0
RUST_VERSION: 1.83.0

jobs:
nodejs:
Expand Down
22 changes: 11 additions & 11 deletions Cargo.lock

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

20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ and Javascript to create a well-tested, secure, client/server application.
This monorepo includes all design notes and a set of build and test tools that
are developed similarly to the main application, using TDD.

# Major Technologies
## Major Technologies

* Go
* Go is used to develop the server and tools
* Rust
* Rust is used to develop the server and tools
* Javascript
* Javascript is used to develop the user interface, the client
* Reef.js is used to assist with reactive components
Expand All @@ -30,7 +30,7 @@ are developed similarly to the main application, using TDD.
* Make
* Make is used to automate build tasks

# Update dependencies
## Update dependencies

* Regex search the repository for:

Expand All @@ -51,7 +51,16 @@ are developed similarly to the main application, using TDD.
npx npm-check-updates -u
```

## Remove untracked files

Linux is able to handle globbing with large numbers of files, but MacOS might fail. This will work on both platforms.

```sh
(find . -type f; find . -type d) | xargs git check-ignore | xargs rm -rf
```

Current mindmap idea:
```
@startmindmap
* root
** api/v1
Expand Down Expand Up @@ -80,4 +89,5 @@ Current mindmap idea:
*** get
**** resource handler
** not found handler
@endmindmap
@endmindmap
```
2 changes: 1 addition & 1 deletion ci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = "4.5.21"
clap = "4.5.23"
serde_json = "1.0.133"
sha2 = "0.10.8"
6 changes: 6 additions & 0 deletions ci/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ pub struct Cli {
#[arg(short, long)]
fail_fast: bool,

/// Use headed (GUI) browsers for e2e tests
#[arg(short = 'e', long)]
headed: bool,

/// Runner for scripts [docker, shell]
#[arg(short, long, default_value = "docker")]
runner: String,
Expand All @@ -67,6 +71,7 @@ pub fn cmd(args: Cli) {
cwd: std::env::var("HOST_WORKDIR").unwrap_or(
String::from(std::env::current_dir().unwrap().to_str().unwrap())
),
headed: args.headed,
verbose: args.verbose,
});

Expand Down Expand Up @@ -140,6 +145,7 @@ pub type Error = Box<dyn std::error::Error>;
pub struct Context {
pub id: String,
pub cwd: String,
pub headed: bool,
pub verbose: bool,
}

Expand Down
34 changes: 23 additions & 11 deletions ci/src/stages/dev_e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ impl Stage for DevE2E {
}

// run e2e tests against dev servers
fn run(&self, _context: &Context, runner: &dyn Runner) -> Result<(), Error> {
fn run(&self, context: &Context, runner: &dyn Runner) -> Result<(), Error> {
let expiration = 3000;

node_dev_e2e(expiration, runner)?;
node_dev_e2e(expiration, runner, context)?;

rust_dev_e2e(expiration, runner)
rust_dev_e2e(expiration, runner, context)
}
}

fn node_dev_e2e(expiration: u32, runner: &dyn Runner) -> Result<(), Error> {
fn node_dev_e2e(expiration: u32, runner: &dyn Runner, context: &Context) -> Result<(), Error> {
let server = runner.run_background(
ExecutionContext::Build,
vec![],
Expand All @@ -38,11 +38,16 @@ fn node_dev_e2e(expiration: u32, runner: &dyn Runner) -> Result<(), Error> {
ExecutionContext::E2E,
vec![],
true,
&cypress_script(&server.addr(), "node-dev", &BROWSERS),
&cypress_script(
&server.addr(),
"node-dev",
&BROWSERS,
context.headed,
),
)
}

fn rust_dev_e2e(expiration: u32, runner: &dyn Runner) -> Result<(), Error> {
fn rust_dev_e2e(expiration: u32, runner: &dyn Runner, context: &Context) -> Result<(), Error> {
runner.run(
ExecutionContext::Build,
vec![&format!(
Expand Down Expand Up @@ -86,22 +91,29 @@ fn rust_dev_e2e(expiration: u32, runner: &dyn Runner) -> Result<(), Error> {
"CYPRESS_REQUIRE_CLEAN_PERSISTENCE=true",
],
true,
&cypress_script(&server.addr(), "rust-dev", &[browser]),
&cypress_script(
&server.addr(),
"rust-dev",
&[browser],
context.headed,
),
)?;
}

Ok(())
}

fn cypress_script(server_addr: &str, stage_name: &str, browsers: &[&str]) -> String {
fn cypress_script(server_addr: &str, stage_name: &str, browsers: &[&str], headed: bool) -> String {
let headed = if headed { "--headed" } else { "--headless" };
format!(r"
set -xe
cd ui
trap 'mv *-e2e.xml ../test_results/' EXIT
for b in {0}; do
CYPRESS_MOCHA_FILE={2}-$b-e2e.xml npx cypress run \
CYPRESS_MOCHA_FILE={1}-$b-e2e.xml npx cypress run \
{2} \
--browser $b \
--config baseUrl=http://{1}:8080
--config baseUrl=http://{3}:8080
done
", browsers.join(" "), server_addr, stage_name)
", browsers.join(" "), stage_name, headed, server_addr)
}
4 changes: 2 additions & 2 deletions images/build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ ARG NODE_VERSION="23.3.0"
FROM node:${NODE_VERSION}-alpine

# Latest NPM version: https://www.npmjs.com/package/npm
ARG NPM_VERSION="10.9.1"
ARG NPM_VERSION="10.9.2"

# Latest Rust version: https://www.rust-lang.org/
ARG RUST_VERSION="1.82.0"
ARG RUST_VERSION="1.83.0"

# Latest nextest version: https://github.com/nextest-rs/nextest/releases
ARG NEXTEST_VERSION="^0.9"
Expand Down
8 changes: 4 additions & 4 deletions images/e2e.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
ARG NODE_VERSION="23.3.0"

# Latest Chrome version: https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable
ARG CHROME_VERSION="131.0.6778.85-1"
ARG CHROME_VERSION="131.0.6778.108-1"

# Latest Firefox version: https://www.mozilla.org/en-US/firefox/releases/
ARG FIREFOX_VERSION="132.0.2"
ARG FIREFOX_VERSION="133.0"

# Disable other browsers
ARG EDGE_VERSION=
ARG YARN_VERSION=
ARG CYPRESS_VERSION=

# Latest cypress factory version: https://hub.docker.com/r/cypress/factory/tags
FROM cypress/factory:5.1.0
FROM cypress/factory:5.1.1

# Latest NPM version: https://www.npmjs.com/package/npm
ARG NPM_VERSION="10.9.1"
ARG NPM_VERSION="10.9.2"

USER root

Expand Down
4 changes: 2 additions & 2 deletions tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.5.21", features = ["derive"] }
clap = { version = "4.5.23", features = ["derive"] }
regex = "1.11.1"
reqwest = "0.12.9"
serde_yaml = "0.9.34"
tokio = { version = "1.41.1", features = ["full"] }
tokio = { version = "1.42.0", features = ["full"] }
Loading
Loading