Skip to content

Commit d5853a7

Browse files
committed
ci: disabling tests that can't run on a GH virtual machine
1 parent f37cd7a commit d5853a7

File tree

3 files changed

+57
-52
lines changed

3 files changed

+57
-52
lines changed

.github/workflows/build-and-test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
rustup toolchain install stable-x86_64-pc-windows-msvc
172172
- name: Tests
173173
run: |
174-
cargo test --no-default-features --features "prometheus json riemann"
174+
cargo test --no-default-features --features "prometheus prometheuspush json riemann" --test exporters
175175
- name: Build (debug mode)
176176
run: |
177-
cargo build --no-default-features --features "prometheus json riemann"
177+
cargo build --no-default-features --features "prometheus prometheuspush json riemann"

.github/workflows/exe-release-prometheuspush.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
branches: [ '336-proper-handling-of-windows-service-management' ]
1313

1414
env:
15-
WRD_VERSION: v0.0.3
15+
WRD_VERSION: v0.0.4
1616
WRD_BASE_URL: https://github.com/hubblo-org/windows-rapl-driver/releases/download
1717

1818
jobs:

src/sensors/msr_rapl.rs

+54-49
Original file line numberDiff line numberDiff line change
@@ -756,58 +756,63 @@ pub unsafe fn get_msr_value(
756756
error!("Error was : {:?}", GetLastError());
757757
}
758758
debug!("Core ID requested to the driver : {}", core_id);
759-
match get_handle(sensor_data.get("DRIVER_NAME").unwrap()) {
760-
Ok(device) => {
761-
let mut msr_result: u64 = 0;
762-
let ptr_result = &mut msr_result as *mut u64;
763-
debug!("msr_addr: {:b}", msr_addr);
764-
debug!("core_id: {:x} {:b}", (core_id as u64), (core_id as u64));
765-
debug!("core_id: {:b}", ((core_id as u64) << 32));
766-
let src = ((core_id as u64) << 32) | msr_addr; //let src = ((core_id as u64) << 32) | msr_addr;
767-
let ptr = &src as *const u64;
768-
769-
debug!("src: {:x}", src);
770-
debug!("src: {:b}", src);
771-
debug!("*ptr: {:b}", *ptr);
772-
//warn!("*ptr: {}", *ptr);
773-
//warn!("*ptr: {:b}", *ptr);
774-
775-
match send_request(
776-
device,
777-
MSR_PKG_ENERGY_STATUS,
778-
ptr,
779-
8,
780-
ptr_result,
781-
size_of::<u64>(),
782-
) {
783-
Ok(_res) => {
784-
close_handle(device);
785-
786-
let energy_unit = sensor_data
787-
.get("ENERGY_UNIT")
788-
.unwrap()
789-
.parse::<f64>()
790-
.unwrap();
791-
let current_value =
792-
MsrRAPLSensor::extract_rapl_current_power(msr_result, energy_unit);
793-
debug!("current_value: {}", current_value);
794-
795-
Ok(Record {
796-
timestamp: current_system_time_since_epoch(),
797-
unit: super::units::Unit::MicroJoule,
798-
value: current_value,
799-
})
759+
match sensor_data.get("DRIVER_NAME") {
760+
Some(driver) => {
761+
match get_handle(driver) {
762+
Ok(device) => {
763+
let mut msr_result: u64 = 0;
764+
let ptr_result = &mut msr_result as *mut u64;
765+
debug!("msr_addr: {:b}", msr_addr);
766+
debug!("core_id: {:x} {:b}", (core_id as u64), (core_id as u64));
767+
debug!("core_id: {:b}", ((core_id as u64) << 32));
768+
let src = ((core_id as u64) << 32) | msr_addr; //let src = ((core_id as u64) << 32) | msr_addr;
769+
let ptr = &src as *const u64;
770+
771+
debug!("src: {:x}", src);
772+
debug!("src: {:b}", src);
773+
debug!("*ptr: {:b}", *ptr);
774+
//warn!("*ptr: {}", *ptr);
775+
//warn!("*ptr: {:b}", *ptr);
776+
777+
match send_request(
778+
device,
779+
MSR_PKG_ENERGY_STATUS,
780+
ptr,
781+
8,
782+
ptr_result,
783+
size_of::<u64>(),
784+
) {
785+
Ok(_res) => {
786+
close_handle(device);
787+
788+
let energy_unit = sensor_data
789+
.get("ENERGY_UNIT")
790+
.unwrap()
791+
.parse::<f64>()
792+
.unwrap();
793+
let current_value =
794+
MsrRAPLSensor::extract_rapl_current_power(msr_result, energy_unit);
795+
debug!("current_value: {}", current_value);
796+
797+
Ok(Record {
798+
timestamp: current_system_time_since_epoch(),
799+
unit: super::units::Unit::MicroJoule,
800+
value: current_value,
801+
})
802+
}
803+
Err(e) => {
804+
info!("Failed to get data from send_request: {:?}", e);
805+
close_handle(device);
806+
Err(format!("Failed to get data from send_request: {:?}", e))
807+
}
808+
}
800809
}
801810
Err(e) => {
802-
info!("Failed to get data from send_request: {:?}", e);
803-
close_handle(device);
804-
Err(format!("Failed to get data from send_request: {:?}", e))
811+
error!("Couldn't get driver handle : {:?}", e);
812+
Err(format!("Couldn't get driver handle : {:?}", e))
805813
}
806814
}
807815
}
808-
Err(e) => {
809-
error!("Couldn't get driver handle : {:?}", e);
810-
Err(format!("Couldn't get driver handle : {:?}", e))
811-
}
816+
None => { panic!("DRIVER_NAME not set."); }
812817
}
813-
}
818+
}

0 commit comments

Comments
 (0)