Skip to contentSkip to conversation

CodeSamples: Add check target to CodeSamples/ and count/ Makefiles

PATCH Applied Leonardo Bras 3 participants 6 messages Feb 4, 2023 – Feb 6, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 CodeSamples: Add check target to CodeSamples/ and count/ Makefiles

Checking happens by running every program compiled from count/ without arguments and checking if any failed.

In order to do that, introduce a 'check' target in CodeSamples/count/Makefile.

Also, to allow further CodeSample testing in the future, make a global 'check' target on CodeSamples/Makefile.

---
 CodeSamples/Makefile       | 3 +++
 CodeSamples/count/Makefile | 3 +++
 2 files changed, 6 insertions(+)
CodeSamples/Makefile +3 -0
index 38143638..2a433a22 100644
@@ -66,5 +66,8 @@ ifneq ($(strip $(target)),)
 	cat arch-$(target)/Makefile.arch >> Makefile.arch
 endif
 
+check:
+	make -C count/ check
+
 clean:
 	rm -f Makefile.arch api.h
CodeSamples/count/Makefile +3 -0
index f54edc8c..8d5d4296 100644
@@ -90,5 +90,8 @@ count_stat_eventual: count_stat_eventual.c ../api.h counttorture.h
 count_tstat: count_tstat.c ../api.h counttorture.h
 	$(CC) $(GCC_ARGS) $(CFLAGS) -o count_tstat count_tstat.c -lpthread
 
+check: $(PROGS)
+	$(foreach prog, $(PROGS), ./$(prog);)
+
 clean:
 	rm -f $(PROGS)
Signature · 1 line
2.39.1
#1 lore raw

PATCH 2/2 utilities/gitlab-ci.yml: Add 'make check' on test_codesamples

Call make -C CodeSamples/ check on test_codesamples, so any runtime error can be detected by Gitlab-CI.

---
 utilities/gitlab-ci.yml | 1 +
 1 file changed, 1 insertion(+)
utilities/gitlab-ci.yml +1 -0
index f2cb1c8e..7f50f12a 100644
@@ -12,6 +12,7 @@ test_codesamples:
 
     script:
         - make -C CodeSamples/
+        - make -C CodeSamples/ check
 
 generate_pdfs:
     stage: build
Signature · 1 line
2.39.1
#2 lore raw

Re: [PATCH v1 2/2] utilities/gitlab-ci.yml: Add 'make check' on test_codesamples

Quoted 4 lines · Leonardo Bras

Call make -C CodeSamples/ check on test_codesamples, so any runtime error can be detected by Gitlab-CI.

I queued and pushed all three, thank you!

Thanx, Paul

Quoted 19 lines
---
 utilities/gitlab-ci.yml | 1 +
 1 file changed, 1 insertion(+)
utilities/gitlab-ci.yml +1 -0
index f2cb1c8e..7f50f12a 100644
@@ -12,6 +12,7 @@ test_codesamples:
 
     script:
         - make -C CodeSamples/
+        - make -C CodeSamples/ check
 
 generate_pdfs:
     stage: build
Signature · 1 line
2.39.1
#3 lore raw

Re: [PATCH v1 2/2] utilities/gitlab-ci.yml: Add 'make check' on test_codesamples

Quoted 10 lines · Paul E. McKenney
Quoted 4 lines · Leonardo Bras

Call make -C CodeSamples/ check on test_codesamples, so any runtime error can be detected by Gitlab-CI.

I queued and pushed all three, thank you!

Thanx, Paul

Thank you Paul!

It looks like my pipeline failed with:

sched_setaffinity: Invalid argument

Which got me to look for some info:
- The Gitlab-CI instances are all single-cpu.

Which got me thinking:
- How would we be able to test code for Parallel Programming in a single cpu?

Well, I still haven't debugged all this, after I am sure this is the issue, I will reach people from Gitlab and check if is there any solution for this.

Best regards,
Leo

Quoted 19 lines
Quoted 19 lines
---
 utilities/gitlab-ci.yml | 1 +
 1 file changed, 1 insertion(+)
utilities/gitlab-ci.yml +1 -0
index f2cb1c8e..7f50f12a 100644
@@ -12,6 +12,7 @@ test_codesamples:
 
     script:
         - make -C CodeSamples/
+        - make -C CodeSamples/ check
 
 generate_pdfs:
     stage: build
Signature · 1 line
2.39.1
#4 lore raw

Re: [PATCH v1 2/2] utilities/gitlab-ci.yml: Add 'make check' on test_codesamples

On Sat, 04 Feb 2023 03:09:08 -0300, Leonardo Brás wrote:
...

Quoted 5 lines

Thank you Paul!

It looks like my pipeline failed with:

Quoted 7 lines

sched_setaffinity: Invalid argument

Which got me to look for some info:
- The Gitlab-CI instances are all single-cpu.

Which got me thinking:
- How would we be able to test code for Parallel Programming in a single cpu?

I assume you are using a runner gitlab provides. If this is the case, according to the page at gitlab:

https://docs.gitlab.com/ee/ci/runners/saas/linux_saas_runner.html

, there are three machine types you can choose.

- Small: 1 vCPU (default)
- Medium: 2 vCPUs
- Large: 4 vCPUs (not available for free subscription)

Hope this helps.

Thanks, Akira

Quoted 6 lines

Well, I still haven't debugged all this, after I am sure this is the issue, I will reach people from Gitlab and check if is there any solution for this.

Best regards,
Leo

#5 lore raw

Re: [PATCH v1 2/2] utilities/gitlab-ci.yml: Add 'make check' on test_codesamples

Quoted 22 lines · Akira Yokosawa

On Sat, 04 Feb 2023 03:09:08 -0300, Leonardo Brás wrote:
...

Quoted 5 lines

Thank you Paul!

It looks like my pipeline failed with:

Quoted 7 lines

sched_setaffinity: Invalid argument

Which got me to look for some info:
- The Gitlab-CI instances are all single-cpu.

Which got me thinking:
- How would we be able to test code for Parallel Programming in a single cpu?

I assume you are using a runner gitlab provides. If this is the case, according to the page at gitlab:

https://docs.gitlab.com/ee/ci/runners/saas/linux_saas_runner.html

, there are three machine types you can choose.

Quoted 7 lines

- Small: 1 vCPU (default)
- Medium: 2 vCPUs
- Large: 4 vCPUs (not available for free subscription)

Hope this helps.

Thanks, Akira

Sure it helps. Thanks Akira!

I will send a patch fixing this as soon as I test it first.

Best regards,
Leo

Quoted 8 lines
Quoted 7 lines

Well, I still haven't debugged all this, after I am sure this is the issue, I will reach people from Gitlab and check if is there any solution for this.

Best regards,
Leo