Compare commits
1 Commits
2fb57daaec
...
feature_ma
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
678106bb65 |
@@ -14,10 +14,6 @@ spec:
|
|||||||
- name: path-to-dockerfile
|
- name: path-to-dockerfile
|
||||||
description: The path to the Dockerfile
|
description: The path to the Dockerfile
|
||||||
type: string
|
type: string
|
||||||
- name: command
|
|
||||||
type: array
|
|
||||||
description: Command to run.
|
|
||||||
default: []
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: report-pending
|
- name: report-pending
|
||||||
taskRef:
|
taskRef:
|
||||||
@@ -81,9 +77,19 @@ spec:
|
|||||||
workspace: docker-credentials
|
workspace: docker-credentials
|
||||||
runAfter:
|
runAfter:
|
||||||
- fetch-repository
|
- fetch-repository
|
||||||
- name: run-image-none
|
- name: build-organic
|
||||||
taskRef:
|
taskRef:
|
||||||
name: run-docker-image
|
name: run-docker-image
|
||||||
|
matrix:
|
||||||
|
params:
|
||||||
|
- name: feature-compare
|
||||||
|
value:
|
||||||
|
- "true"
|
||||||
|
- "false"
|
||||||
|
- name: feature-tracing
|
||||||
|
value:
|
||||||
|
- "true"
|
||||||
|
- "false"
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: source
|
||||||
workspace: git-source
|
workspace: git-source
|
||||||
@@ -93,77 +99,21 @@ spec:
|
|||||||
- build-image
|
- build-image
|
||||||
params:
|
params:
|
||||||
- name: command
|
- name: command
|
||||||
value: ["$(params.command[*])"]
|
value: ["/bin/sh", "-c"]
|
||||||
- name: args
|
- name: args
|
||||||
value: ["--no-default-features"]
|
value:
|
||||||
- name: docker-image
|
- |
|
||||||
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
set -euo pipefail
|
||||||
- name: run-image-tracing
|
IFS=$$'\n\t'
|
||||||
taskRef:
|
features=()
|
||||||
name: run-docker-image
|
if [ $(params.feature-compare) = "true" ]; then features+=(compare); fi
|
||||||
workspaces:
|
if [ $(params.feature-tracing) = "true" ]; then features+=(tracing); fi
|
||||||
- name: source
|
if [ $${#features[@]} -eq 0 ]; then
|
||||||
workspace: git-source
|
exec cargo build --no-default-features
|
||||||
- name: cargo-cache
|
else
|
||||||
workspace: cargo-cache
|
featurelist=$$(IFS="," ; echo "$${features[*]}")
|
||||||
runAfter:
|
exec cargo build --no-default-features --features "$$featurelist"
|
||||||
- run-image-none
|
fi
|
||||||
params:
|
|
||||||
- name: command
|
|
||||||
value: ["$(params.command[*])"]
|
|
||||||
- name: args
|
|
||||||
value: ["--no-default-features", "--features", "tracing"]
|
|
||||||
- name: docker-image
|
|
||||||
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
|
||||||
- name: run-image-compare
|
|
||||||
taskRef:
|
|
||||||
name: run-docker-image
|
|
||||||
workspaces:
|
|
||||||
- name: source
|
|
||||||
workspace: git-source
|
|
||||||
- name: cargo-cache
|
|
||||||
workspace: cargo-cache
|
|
||||||
runAfter:
|
|
||||||
- run-image-tracing
|
|
||||||
params:
|
|
||||||
- name: command
|
|
||||||
value: ["$(params.command[*])"]
|
|
||||||
- name: args
|
|
||||||
value: ["--no-default-features", "--features", "compare"]
|
|
||||||
- name: docker-image
|
|
||||||
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
|
||||||
- name: run-image-default
|
|
||||||
taskRef:
|
|
||||||
name: run-docker-image
|
|
||||||
workspaces:
|
|
||||||
- name: source
|
|
||||||
workspace: git-source
|
|
||||||
- name: cargo-cache
|
|
||||||
workspace: cargo-cache
|
|
||||||
runAfter:
|
|
||||||
- run-image-compare
|
|
||||||
params:
|
|
||||||
- name: command
|
|
||||||
value: ["$(params.command[*])"]
|
|
||||||
- name: args
|
|
||||||
value: []
|
|
||||||
- name: docker-image
|
|
||||||
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
|
||||||
- name: run-image-all
|
|
||||||
taskRef:
|
|
||||||
name: run-docker-image
|
|
||||||
workspaces:
|
|
||||||
- name: source
|
|
||||||
workspace: git-source
|
|
||||||
- name: cargo-cache
|
|
||||||
workspace: cargo-cache
|
|
||||||
runAfter:
|
|
||||||
- run-image-default
|
|
||||||
params:
|
|
||||||
- name: command
|
|
||||||
value: ["$(params.command[*])"]
|
|
||||||
- name: args
|
|
||||||
value: ["--no-default-features", "--features", "tracing,compare"]
|
|
||||||
- name: docker-image
|
- name: docker-image
|
||||||
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
value: "$(params.image-name):$(tasks.fetch-repository.results.commit)"
|
||||||
finally:
|
finally:
|
||||||
@@ -256,5 +206,3 @@ spec:
|
|||||||
value: docker/organic_build/
|
value: docker/organic_build/
|
||||||
- name: path-to-dockerfile
|
- name: path-to-dockerfile
|
||||||
value: docker/organic_build/Dockerfile
|
value: docker/organic_build/Dockerfile
|
||||||
- name: command
|
|
||||||
value: [cargo, build]
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||||||
: ${SHELL:="NO"} # or YES to launch a shell instead of running the test
|
: ${SHELL:="NO"} # or YES to launch a shell instead of running the test
|
||||||
: ${TRACE:="NO"} # or YES to send traces to jaeger
|
: ${TRACE:="NO"} # or YES to send traces to jaeger
|
||||||
: ${BACKTRACE:="NO"} # or YES to print a rust backtrace when panicking
|
: ${BACKTRACE:="NO"} # or YES to print a rust backtrace when panicking
|
||||||
: ${NO_COLOR:=""} # Set to anything to disable color output
|
|
||||||
|
|
||||||
|
|
||||||
cd "$DIR/../"
|
cd "$DIR/../"
|
||||||
REALPATH=$(command -v uu-realpath || command -v realpath)
|
REALPATH=$(command -v uu-realpath || command -v realpath)
|
||||||
@@ -27,10 +25,6 @@ function launch_container {
|
|||||||
local additional_flags=()
|
local additional_flags=()
|
||||||
local additional_args=()
|
local additional_args=()
|
||||||
|
|
||||||
if [ "$NO_COLOR" != "" ]; then
|
|
||||||
additional_flags+=(--env "NO_COLOR=$NO_COLOR")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$SHELL" != "YES" ]; then
|
if [ "$SHELL" != "YES" ]; then
|
||||||
additional_args+=(cargo run)
|
additional_args+=(cargo run)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ set -euo pipefail
|
|||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
: ${NO_COLOR:=""} # Set to anything to disable color output
|
|
||||||
|
|
||||||
cd "$DIR/../"
|
cd "$DIR/../"
|
||||||
REALPATH=$(command -v uu-realpath || command -v realpath)
|
REALPATH=$(command -v uu-realpath || command -v realpath)
|
||||||
MAKE=$(command -v gmake || command -v make)
|
MAKE=$(command -v gmake || command -v make)
|
||||||
@@ -42,11 +40,7 @@ function get_test_names {
|
|||||||
|
|
||||||
function launch_container {
|
function launch_container {
|
||||||
local test="$1"
|
local test="$1"
|
||||||
local additional_flags=()
|
local additional_args=()
|
||||||
|
|
||||||
if [ "$NO_COLOR" != "" ]; then
|
|
||||||
additional_flags+=(--env "NO_COLOR=$NO_COLOR")
|
|
||||||
fi
|
|
||||||
|
|
||||||
local init_script=$(cat <<EOF
|
local init_script=$(cat <<EOF
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -56,7 +50,7 @@ cargo test --no-fail-fast --lib --test test_loader "$test" -- --show-output
|
|||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
docker run "${additional_flags[@]}" --init --rm -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test sh -c "$init_script"
|
docker run --init --rm -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test sh -c "$init_script"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -84,24 +84,12 @@ impl DiffResult {
|
|||||||
match self.status {
|
match self.status {
|
||||||
DiffStatus::Good => {
|
DiffStatus::Good => {
|
||||||
if self.has_bad_children() {
|
if self.has_bad_children() {
|
||||||
format!(
|
"BADCHILD"
|
||||||
"{color}BADCHILD{reset}",
|
|
||||||
color = DiffResult::foreground_color(255, 255, 0),
|
|
||||||
reset = DiffResult::reset_color(),
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
format!(
|
"GOOD"
|
||||||
"{color}GOOD{reset}",
|
|
||||||
color = DiffResult::foreground_color(0, 255, 0),
|
|
||||||
reset = DiffResult::reset_color(),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DiffStatus::Bad => format!(
|
DiffStatus::Bad => "BAD",
|
||||||
"{color}BAD{reset}",
|
|
||||||
color = DiffResult::foreground_color(255, 0, 0),
|
|
||||||
reset = DiffResult::reset_color(),
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
println!(
|
println!(
|
||||||
@@ -129,45 +117,6 @@ impl DiffResult {
|
|||||||
DiffStatus::Bad => true,
|
DiffStatus::Bad => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn foreground_color(red: u8, green: u8, blue: u8) -> String {
|
|
||||||
if DiffResult::should_use_color() {
|
|
||||||
format!(
|
|
||||||
"\x1b[38;2;{red};{green};{blue}m",
|
|
||||||
red = red,
|
|
||||||
green = green,
|
|
||||||
blue = blue
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
String::new()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn background_color(red: u8, green: u8, blue: u8) -> String {
|
|
||||||
if DiffResult::should_use_color() {
|
|
||||||
format!(
|
|
||||||
"\x1b[48;2;{red};{green};{blue}m",
|
|
||||||
red = red,
|
|
||||||
green = green,
|
|
||||||
blue = blue
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
String::new()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn reset_color() -> &'static str {
|
|
||||||
if DiffResult::should_use_color() {
|
|
||||||
"\x1b[0m"
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn should_use_color() -> bool {
|
|
||||||
!std::env::var("NO_COLOR").is_ok_and(|val| !val.is_empty())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn compare_element<'s>(
|
fn compare_element<'s>(
|
||||||
|
|||||||
@@ -45,11 +45,7 @@ fn name<'r, 's>(
|
|||||||
// TODO: This should be defined by org-entities and optionally org-entities-user
|
// TODO: This should be defined by org-entities and optionally org-entities-user
|
||||||
|
|
||||||
// TODO: Add the rest of the entities, this is a very incomplete list
|
// TODO: Add the rest of the entities, this is a very incomplete list
|
||||||
let (remaining, proto) = alt((alt((
|
let (remaining, proto) = alt((alt((tag_no_case("delta"), tag_no_case("pi"))),))(input)?;
|
||||||
tag_no_case("delta"),
|
|
||||||
tag_no_case("pi"),
|
|
||||||
tag_no_case("ast"),
|
|
||||||
)),))(input)?;
|
|
||||||
Ok((remaining, proto))
|
Ok((remaining, proto))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,36 +189,3 @@ pub fn regular_link_description_object_set<'r, 's>(
|
|||||||
parser_with_context!(minimal_set_object)(context),
|
parser_with_context!(minimal_set_object)(context),
|
||||||
))(input)
|
))(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
|
||||||
pub fn table_cell_set_object<'r, 's>(
|
|
||||||
context: Context<'r, 's>,
|
|
||||||
input: OrgSource<'s>,
|
|
||||||
) -> Res<OrgSource<'s>, Object<'s>> {
|
|
||||||
alt((
|
|
||||||
map(parser_with_context!(citation)(context), Object::Citation),
|
|
||||||
map(
|
|
||||||
parser_with_context!(export_snippet)(context),
|
|
||||||
Object::ExportSnippet,
|
|
||||||
),
|
|
||||||
map(
|
|
||||||
parser_with_context!(footnote_reference)(context),
|
|
||||||
Object::FootnoteReference,
|
|
||||||
),
|
|
||||||
map(parser_with_context!(radio_link)(context), Object::RadioLink),
|
|
||||||
map(
|
|
||||||
parser_with_context!(regular_link)(context),
|
|
||||||
Object::RegularLink,
|
|
||||||
),
|
|
||||||
map(parser_with_context!(plain_link)(context), Object::PlainLink),
|
|
||||||
map(parser_with_context!(angle_link)(context), Object::AngleLink),
|
|
||||||
map(parser_with_context!(org_macro)(context), Object::OrgMacro),
|
|
||||||
map(
|
|
||||||
parser_with_context!(radio_target)(context),
|
|
||||||
Object::RadioTarget,
|
|
||||||
),
|
|
||||||
map(parser_with_context!(target)(context), Object::Target),
|
|
||||||
map(parser_with_context!(timestamp)(context), Object::Timestamp),
|
|
||||||
parser_with_context!(minimal_set_object)(context),
|
|
||||||
))(input)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -12,13 +12,14 @@ use nom::multi::many1;
|
|||||||
use nom::multi::many_till;
|
use nom::multi::many_till;
|
||||||
use nom::sequence::tuple;
|
use nom::sequence::tuple;
|
||||||
|
|
||||||
use super::object_parser::table_cell_set_object;
|
|
||||||
use super::org_source::OrgSource;
|
use super::org_source::OrgSource;
|
||||||
use super::Context;
|
use super::Context;
|
||||||
use crate::error::Res;
|
use crate::error::Res;
|
||||||
use crate::parser::exiting::ExitClass;
|
use crate::parser::exiting::ExitClass;
|
||||||
use crate::parser::greater_element::TableRow;
|
use crate::parser::greater_element::TableRow;
|
||||||
use crate::parser::lesser_element::TableCell;
|
use crate::parser::lesser_element::TableCell;
|
||||||
|
use crate::parser::object::Object;
|
||||||
|
use crate::parser::object_parser::minimal_set_object;
|
||||||
use crate::parser::parser_context::ContextElement;
|
use crate::parser::parser_context::ContextElement;
|
||||||
use crate::parser::parser_context::ExitMatcherNode;
|
use crate::parser::parser_context::ExitMatcherNode;
|
||||||
use crate::parser::parser_with_context::parser_with_context;
|
use crate::parser::parser_with_context::parser_with_context;
|
||||||
@@ -161,3 +162,14 @@ fn org_mode_table_cell_end<'r, 's>(
|
|||||||
) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||||
recognize(tuple((space0, alt((tag("|"), peek(line_ending))))))(input)
|
recognize(tuple((space0, alt((tag("|"), peek(line_ending))))))(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||||
|
pub fn table_cell_set_object<'r, 's>(
|
||||||
|
context: Context<'r, 's>,
|
||||||
|
input: OrgSource<'s>,
|
||||||
|
) -> Res<OrgSource<'s>, Object<'s>> {
|
||||||
|
not(|i| context.check_exit_matcher(i))(input)?;
|
||||||
|
|
||||||
|
parser_with_context!(minimal_set_object)(context)(input)
|
||||||
|
// TODO: add citations, export snippets, footnote references, links, macros, radio targets, targets, and timestamps.
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user