Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dragoonfly
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dragoon
Dragoonfly
Commits
2e36ec21
Commit
2e36ec21
authored
Apr 23, 2024
by
DISSOUBRAY Nathan
Committed by
DETCHART Jonathan
Apr 23, 2024
Browse files
Options
Downloads
Patches
Plain Diff
setup the CI
parent
fa07831a
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!4
Trying to setup the CI
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+0
-0
0 additions, 0 deletions
.gitlab-ci.yml
tests/message_exchange.nu
+58
-35
58 additions, 35 deletions
tests/message_exchange.nu
with
58 additions
and
35 deletions
.gitlab-ci.yml
.old
→
.gitlab-ci.yml
+
0
−
0
View file @
2e36ec21
File moved
This diff is collapsed.
Click to expand it.
tests/message_exchange.nu
+
58
−
35
View file @
2e36ec21
...
...
@@ -6,14 +6,13 @@ use std assert
let SWARM = swarm create 2
let record_name = "tata"
let message = "it works at least"
let sleep_duration = 1sec
mut node_is_setup = false
# create the nodes
swarm run --no-shell $SWARM
print "Sleeping for 1s to setup ports"
sleep 1sec
print "Resuming execution"
try {
print "Env var inside the script"
try {
print $'http_proxy: ($env.http_proxy)'
...
...
@@ -27,11 +26,29 @@ try {
print "HTTP_PROXY not set"
}
let original_time = date now
# make the node start to listen on their own ports
print "Node 0 listening"
print "Trying to listen with node 0"
while not $node_is_setup {
# try to listen on node 0, this is to allow time for the ports to setup properly
try {
sleep 1sec
app listen --node $SWARM.0.ip_port $SWARM.0.multiaddr
print "Node 1 listening"
print "Exiting the try-listen"
$node_is_setup = true
} catch {
let current_time = (date now)
let elapsed_time = $current_time - $original_time
print -n $"Failed to listen, elapsed_time: ($elapsed_time | format duration sec)\r"
}
}
print $"Successfully listening on node 0, took: ((date now) - $original_time | format duration sec)"
# Node 1 doesn't need the same kind of setup as node 0, since it's only needed for the first node to do this
print "Trying to listen with node 1"
app listen --node $SWARM.1.ip_port $SWARM.1.multiaddr
print "Node 1 listening"
# connect the nodes
print "Node 0 dialing node 1"
...
...
@@ -40,8 +57,9 @@ app dial --node $SWARM.0.ip_port $SWARM.1.multiaddr
# announce that you provide a key and add a message with the given key
print "Node 0 announces it has a given record"
app start-provide --node $SWARM.0.ip_port $record_name
print "Sleeping for 1s"
sleep 1sec
# a short sleep to ensure everything is setup properly
print $"Sleeping for ($sleep_duration)"
sleep $sleep_duration
print "Node 0 gives a value associated with the record key"
app put-record --node $SWARM.0.ip_port $record_name $message
...
...
@@ -55,3 +73,8 @@ print "Killing the swarm"
swarm kill --no-shell
assert equal $res $message
} catch {
print "Test failed"
print "Killing the swarm"
swarm kill --no-shell
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment