Skip to content

Commit

Permalink
Merge pull request #104 from pyohannes/windows-tests
Browse files Browse the repository at this point in the history
Enable tests on Windows and MacOS
  • Loading branch information
jsuereth authored Apr 12, 2024
2 parents 57e6f1a + 8aa2d53 commit 1a594d8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
name: Test
strategy:
matrix:
# os: [ "ubuntu-latest", "windows-latest", "macos-latest" ]
os: [ "ubuntu-latest"]
os: [ "ubuntu-latest", "windows-latest", "macos-latest" ]
rust: [ "stable" ]
continue-on-error: ${{ matrix.rust != 'stable' }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -187,4 +186,4 @@ jobs:
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: open-telemetry/weaver
slug: open-telemetry/weaver
4 changes: 2 additions & 2 deletions crates/weaver_resolved_schema/src/lineage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ impl AttributeLineage {

impl GroupLineage {
/// Creates a new group lineage.
pub fn new(provenance: String) -> Self {
pub fn new(provenance: &str) -> Self {
Self {
source_file: provenance,
source_file: provenance.replace('\\', "/"),
attributes: Default::default(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/weaver_resolver/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ fn group_from_spec(group: GroupSpecWithProvenance) -> UnresolvedGroup {
instrument: group.spec.instrument,
unit: group.spec.unit,
name: group.spec.name,
lineage: Some(GroupLineage::new(group.provenance.clone())),
lineage: Some(GroupLineage::new(&group.provenance)),
},
attributes: attrs,
provenance: group.provenance,
Expand Down
2 changes: 1 addition & 1 deletion crates/weaver_semconv_gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ pub fn update_markdown(
dry_run: bool,
attribute_registry_base_url: Option<&str>,
) -> Result<(), Error> {
let original_markdown = fs::read_to_string(file)?;
let original_markdown = fs::read_to_string(file)?.replace("\r\n", "\n");
let updated_markdown =
update_markdown_contents(&original_markdown, lookup, attribute_registry_base_url)?;
if !dry_run {
Expand Down
11 changes: 6 additions & 5 deletions crates/weaver_template/src/sdkgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ impl ClientSdkGenerator {
.map_err(|e| InternalError(e.to_string()))?;
let tmpl_file = relative_path
.to_str()
.map(|path| path.replace('\\', "/"))
.ok_or(InvalidTemplateFile(tmpl_file_path.clone()))?;

if tmpl_file.ends_with(".macro.tera") {
Expand All @@ -269,7 +270,7 @@ impl ClientSdkGenerator {
if let Some(resource_metrics) = schema_spec.resource_metrics.as_ref() {
for metric in resource_metrics.metrics.iter() {
templates.push(TemplateObjectPair::Metric {
template: tmpl_file.into(),
template: tmpl_file.clone(),
metric,
});
}
Expand All @@ -279,7 +280,7 @@ impl ClientSdkGenerator {
if let Some(resource_metrics) = schema_spec.resource_metrics.as_ref() {
for metric_group in resource_metrics.metric_groups.iter() {
templates.push(TemplateObjectPair::MetricGroup {
template: tmpl_file.into(),
template: tmpl_file.clone(),
metric_group,
});
}
Expand All @@ -289,7 +290,7 @@ impl ClientSdkGenerator {
if let Some(events) = schema_spec.resource_events.as_ref() {
for event in events.events.iter() {
templates.push(TemplateObjectPair::Event {
template: tmpl_file.into(),
template: tmpl_file.clone(),
event,
});
}
Expand All @@ -299,7 +300,7 @@ impl ClientSdkGenerator {
if let Some(spans) = schema_spec.resource_spans.as_ref() {
for span in spans.spans.iter() {
templates.push(TemplateObjectPair::Span {
template: tmpl_file.into(),
template: tmpl_file.clone(),
span,
});
}
Expand All @@ -311,7 +312,7 @@ impl ClientSdkGenerator {
_ = relative_path.set_extension("");

templates.push(TemplateObjectPair::Other {
template: tmpl_file.into(),
template: tmpl_file.clone(),
relative_path,
object: schema,
});
Expand Down

0 comments on commit 1a594d8

Please sign in to comment.